{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/jiangxinyang848/anaconda3/envs/jiang/lib/python3.5/site-packages/sklearn/utils/fixes.py:313: FutureWarning: numpy not_equal will not check object identity in the future. The comparison did not return the same result as suggested by the identity (`is`)) and will change.\n",
      "  _nan_object_mask = _nan_object_array != _nan_object_array\n"
     ]
    }
   ],
   "source": [
    "import random\n",
    "import time\n",
    "import sys\n",
    "\n",
    "from sklearn.metrics import roc_auc_score, precision_recall_fscore_support, accuracy_score\n",
    "import numpy as np\n",
    "import tensorflow as tf"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 配置config\n",
    "class TrainConfig(object):\n",
    "    epochs = 15\n",
    "    decay_rate = 0.92\n",
    "    learning_rate = 0.01\n",
    "    evaluate_every = 100\n",
    "    checkpoint_every = 100\n",
    "    max_grad_norm = 3.0\n",
    "\n",
    "\n",
    "class ModelConfig(object):\n",
    "    hidden_layers = [200]\n",
    "    dropout_keep_prob = 0.6\n",
    "\n",
    "\n",
    "class Config(object):\n",
    "    batch_size = 10\n",
    "    num_skills = 267\n",
    "    input_size = num_skills * 2\n",
    "\n",
    "    trainConfig = TrainConfig()\n",
    "    modelConfig = ModelConfig()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 生成数据\n",
    "class DataGenerator(object):\n",
    "    # 导入的seqs是train_seqs，或者是test_seqs\n",
    "    def __init__(self, fileName, config):\n",
    "        self.fileName = fileName\n",
    "        self.train_seqs = []\n",
    "        self.test_seqs = []\n",
    "        self.infer_seqs = []\n",
    "        self.batch_size = config.batch_size\n",
    "        self.pos = 0\n",
    "        self.end = False\n",
    "        self.num_skills = config.num_skills\n",
    "        self.skills_to_int = {}  # 知识点到索引的映射\n",
    "        self.int_to_skills = {}  # 索引到知识点的映射\n",
    "\n",
    "    def read_file(self):\n",
    "        # 从文件中读取数据，返回读取出来的数据和知识点个数\n",
    "        # 保存每个学生的做题信息 {学生id: [[知识点id，答题结果], [知识点id，答题结果], ...]}，用一个二元列表来表示一个学生的答题信息\n",
    "        seqs_by_student = {}\n",
    "        skills = []  # 统计知识点的数量，之后输入的向量长度就是两倍的知识点数量\n",
    "        count = 0\n",
    "        with open(self.fileName, 'r') as f:\n",
    "            for line in f:\n",
    "                count += 1\n",
    "                if count > 1:\n",
    "                    fields = line.strip().split(\",\")  # 一个列表，[学生id，知识点id，答题结果]\n",
    "                    student, skill, is_correct = int(fields[0]), int(fields[1]), int(fields[2])\n",
    "                    skills.append(skill)  # skill实际上是用该题所属知识点来表示的\n",
    "                    seqs_by_student[student] = seqs_by_student.get(student, []) + [[skill, is_correct]]  # 保存每个学生的做题信息\n",
    "        return seqs_by_student, list(set(skills))\n",
    "\n",
    "    def gen_dict(self, unique_skills):\n",
    "        \"\"\"\n",
    "        构建知识点映射表，将知识点id映射到[0, 1, 2...]表示\n",
    "        :param unique_skills: 无重复的知识点列表\n",
    "        :return:\n",
    "        \"\"\"\n",
    "        sorted_skills = sorted(unique_skills)\n",
    "        skills_to_int = {}\n",
    "        int_to_skills = {}\n",
    "        for i in range(len(sorted_skills)):\n",
    "            skills_to_int[sorted_skills[i]] = i\n",
    "            int_to_skills[i] = sorted_skills[i]\n",
    "\n",
    "        self.skills_to_int = skills_to_int\n",
    "        self.int_to_skills = int_to_skills\n",
    "\n",
    "    def split_dataset(self, seqs_by_student, sample_rate=0.2, random_seed=1):\n",
    "        # 将数据分割成测试集和训练集\n",
    "        sorted_keys = sorted(seqs_by_student.keys())  # 得到排好序的学生id的列表\n",
    "\n",
    "        random.seed(random_seed)\n",
    "        # 随机抽取学生id，将这部分学生作为测试集\n",
    "        test_keys = set(random.sample(sorted_keys, int(len(sorted_keys) * sample_rate)))\n",
    "\n",
    "        # 此时是一个三层的列表来表示的，最外层的列表中的每一个列表表示一个学生的做题信息\n",
    "        test_seqs = [seqs_by_student[k] for k in seqs_by_student if k in test_keys]\n",
    "        train_seqs = [seqs_by_student[k] for k in seqs_by_student if k not in test_keys]\n",
    "        return train_seqs, test_seqs\n",
    "\n",
    "    def gen_attr(self, is_infer=False):\n",
    "        \"\"\"\n",
    "        生成待处理的数据集\n",
    "        :param is_infer: 判断当前是训练模型还是利用模型进行预测\n",
    "        :return:\n",
    "        \"\"\"\n",
    "        if is_infer:\n",
    "            seqs_by_students, skills = self.read_file()\n",
    "            self.infer_seqs = seqs_by_students\n",
    "        else:\n",
    "            seqs_by_students, skills = self.read_file()\n",
    "            train_seqs, test_seqs = self.split_dataset(seqs_by_students)\n",
    "            self.train_seqs = train_seqs\n",
    "            self.test_seqs = test_seqs\n",
    "\n",
    "        self.gen_dict(skills)  # 生成知识点到索引的映射字典\n",
    "\n",
    "    def pad_sequences(self, sequences, maxlen=None, value=0.):\n",
    "        # 按每个batch中最长的序列进行补全, 传入的sequences是二层列表\n",
    "        # 统计一个batch中每个序列的长度，其实等于seqs_len\n",
    "        lengths = [len(s) for s in sequences]\n",
    "        # 统计下该batch中序列的数量\n",
    "        nb_samples = len(sequences)\n",
    "        # 如果没有传入maxlen参数就自动获取最大的序列长度\n",
    "        if maxlen is None:\n",
    "            maxlen = np.max(lengths)\n",
    "        # 构建x矩阵\n",
    "        x = (np.ones((nb_samples, maxlen)) * value).astype(np.int32)\n",
    "\n",
    "        # 遍历batch，去除每一个序列\n",
    "        for idx, s in enumerate(sequences):\n",
    "            trunc = np.asarray(s, dtype=np.int32)\n",
    "            x[idx, :len(trunc)] = trunc\n",
    "\n",
    "        return x\n",
    "\n",
    "    def num_to_one_hot(self, num, dim):\n",
    "        # 将题目转换成one-hot的形式， 其中dim=num_skills * 2，前半段表示错误，后半段表示正确\n",
    "        base = np.zeros(dim)\n",
    "        if num >= 0:\n",
    "            base[num] += 1\n",
    "        return base\n",
    "\n",
    "    def format_data(self, seqs):\n",
    "        # 生成输入数据和输出数据，输入数据是每条序列的前n-1个元素，输出数据是每条序列的后n-1个元素\n",
    "\n",
    "        # 统计一个batch_size中每条序列的长度，在这里不对序列固定长度，通过条用tf.nn.dynamic_rnn让序列长度可以不固定\n",
    "        seq_len = np.array(list(map(lambda seq: len(seq) - 1, seqs)))\n",
    "        max_len = max(seq_len)  # 获得一个batch_size中最大的长度\n",
    "        # i表示第i条数据，j只从0到len(i)-1，x作为输入只取前len(i)-1个，sequences=[j[0] + num_skills * j[1], ....]\n",
    "        # 此时要将知识点id j[0] 转换成index表示\n",
    "        x_sequences = np.array([[(self.skills_to_int[j[0]] + self.num_skills * j[1]) for j in i[:-1]] for i in seqs])\n",
    "        # 将输入的序列用-1进行补全，补全后的长度为当前batch的最大序列长度\n",
    "        x = self.pad_sequences(x_sequences, maxlen=max_len, value=-1)\n",
    "\n",
    "        # 构建输入值input_x，x为一个二层列表，i表示一个学生的做题信息，也就是一个序列，j就是一道题的信息\n",
    "        input_x = np.array([[self.num_to_one_hot(j, self.num_skills * 2) for j in i] for i in x])\n",
    "\n",
    "        # 遍历batch_size，然后取每条序列的后len(i)-1 个元素中的知识点id为target_id\n",
    "        target_id_seqs = np.array([[self.skills_to_int[j[0]] for j in i[1:]] for i in seqs])\n",
    "        target_id = self.pad_sequences(target_id_seqs, maxlen=max_len, value=0)\n",
    "\n",
    "        # 同target_id\n",
    "        target_correctness_seqs = np.array([[j[1] for j in i[1:]] for i in seqs])\n",
    "        target_correctness = self.pad_sequences(target_correctness_seqs, maxlen=max_len, value=0)\n",
    "\n",
    "        return dict(input_x=input_x, target_id=target_id, target_correctness=target_correctness,\n",
    "                    seq_len=seq_len, max_len=max_len)\n",
    "\n",
    "    def next_batch(self, seqs):\n",
    "        # 接收一个序列，生成batch\n",
    "\n",
    "        length = len(seqs)\n",
    "        num_batchs = length // self.batch_size\n",
    "        start = 0\n",
    "        for i in range(num_batchs):\n",
    "            batch_seqs = seqs[start: start + self.batch_size]\n",
    "            start += self.batch_size\n",
    "            params = self.format_data(batch_seqs)\n",
    "\n",
    "            yield params"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 构建模型\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "def pad_sequences(sequences, maxlen=None, value=0.):\n",
    "    # 按每个batch中最长的序列进行补全, 传入的sequences是二层列表\n",
    "    # 统计一个batch中每个序列的长度，其实等于seqs_len\n",
    "    lengths = [len(s) for s in sequences]\n",
    "    # 统计下该batch中序列的数量\n",
    "    nb_samples = len(sequences)\n",
    "    # 如果没有传入maxlen参数就自动获取最大的序列长度\n",
    "    if maxlen is None:\n",
    "        maxlen = np.max(lengths)\n",
    "\n",
    "    # take the sample shape from the first non empty sequence\n",
    "    # checking for consistency in the main loop below.\n",
    "\n",
    "    x = (np.ones((nb_samples, maxlen)) * value).astype(np.int32)\n",
    "   \n",
    "    # 遍历batch，去除每一个序列\n",
    "    for idx, s in enumerate(sequences):\n",
    "        trunc = np.asarray(s, dtype=np.int32)\n",
    "        x[idx, :len(trunc)] = trunc\n",
    "\n",
    "    return x\n",
    "\n",
    "def num_to_one_hot(num, dim):\n",
    "    # 将题目转换成one-hot的形式， 其中dim=num_skills * 2，前半段表示错误，后半段表示正确\n",
    "    base = np.zeros(dim)\n",
    "    if num >= 0:\n",
    "        base[num] += 1\n",
    "    return base\n",
    "\n",
    "\n",
    "def format_data(seqs, batch_size, num_skills):\n",
    "    # 生成输入数据和输出数据，输入数据是每条序列的前n-1个元素，输出数据是每条序列的后n-1个元素\n",
    "    # \n",
    "    gap = batch_size - len(seqs)\n",
    "    # 在生成batch的时候，整个序列不一定能整除，对于最后的长度不够batch_size的batch进行补全长度\n",
    "    seqs_in = seqs + [[[0, 0]]] * gap \n",
    "    \n",
    "    # 统计一个batch_size中每条序列的长度，在这里不对序列固定长度，通过条用tf.nn.dynamic_rnn让序列长度可以不固定\n",
    "    seq_len = np.array(list(map(lambda seq: len(seq)-1, seqs_in)))\n",
    "    max_len = max(seq_len)  # 获得一个batch_size中最大的长度\n",
    "    # i表示第i条数据，j只从0到len(i)-1，x作为输入只取前len(i)-1个，sequences=[j[0] + num_skills * j[1], ....]\n",
    "    x_sequences = np.array([[(j[0] + num_skills * j[1]) for j in i[:-1]] for i in seqs_in])\n",
    "    # 将输入的序列用-1进行补全，补全后的长度为当前batch的最大序列长度\n",
    "    x = pad_sequences(x_sequences, maxlen=max_len, value=-1)\n",
    "    \n",
    "    # 构建输入值input_x，x为一个二层列表，i表示一个学生的做题信息，也就是一个序列，j就是一道题的信息\n",
    "    input_x = np.array([[num_to_one_hot(j, num_skills * 2) for j in i] for i in x])\n",
    "    \n",
    "    # 遍历batch_size，然后取每条序列的后len(i)-1 个元素中的知识点id为target_id\n",
    "    target_id_seqs = np.array([[j[0] for j in i[1:]] for i in seqs_in])\n",
    "    target_id = pad_sequences(target_id_seqs, maxlen=max_len, value=0)\n",
    "    \n",
    "    # 同target_id\n",
    "    target_correctness_seqs = np.array([[j[1] for j in i[1:]] for i in seqs_in])\n",
    "    target_correctness = pad_sequences(target_correctness_seqs, maxlen=max_len, value=0)\n",
    "    \n",
    "    return input_x, target_id, target_correctness, seq_len, max_len\n",
    "\n",
    "\n",
    "class DataGenerator(object):\n",
    "    # 导入的seqs是train_seqs，或者是test_seqs\n",
    "    def __init__(self, seqs, batch_size, num_skills):\n",
    "        self.seqs = seqs\n",
    "        self.batch_size = batch_size\n",
    "        self.pos = 0\n",
    "        self.end = False\n",
    "        self.size = len(seqs)\n",
    "        self.num_skills = num_skills\n",
    "\n",
    "    def next_batch(self):\n",
    "        batch_size = self.batch_size\n",
    "        if self.pos + batch_size < self.size:\n",
    "            batch_seqs = self.seqs[self.pos:self.pos + batch_size]\n",
    "            self.pos += batch_size\n",
    "        else:\n",
    "            batch_seqs = self.seqs[self.pos:]\n",
    "            self.pos = self.size - 1\n",
    "        if self.pos >= self.size - 1:\n",
    "            self.end = True\n",
    "            \n",
    "        input_x, target_id, target_correctness, seqs_len, max_len = format_data(batch_seqs, batch_size, self.num_skills)\n",
    "        return input_x, target_id, target_correctness, seqs_len, max_len\n",
    "\n",
    "    def shuffle(self):\n",
    "        # 用来打乱训练集\n",
    "        self.pos = 0\n",
    "        self.end = False\n",
    "        np.random.shuffle(self.seqs)\n",
    "\n",
    "    def reset(self):\n",
    "        self.pos = 0\n",
    "        self.end = False"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "batch_size = 10\n",
    "train_generator = DataGenerator(train_seqs, batch_size=batch_size, num_skills=num_skills)\n",
    "test_generator = DataGenerator(test_seqs, batch_size=batch_size, num_skills=num_skills)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[ 0.  0.  0.  0.  0.  0.  1.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.\n",
      "  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.]\n",
      "(10, 139, 248)\n"
     ]
    }
   ],
   "source": [
    "# input_x shape=(batch_size, sequence_len, vector_size)\n",
    "# target_id shape = (batch_size, sequence_len)\n",
    "input_x, target_id, target_correctness, seqs_len, max_len = train_generator.next_batch()\n",
    "\n",
    "print(np.array(input_x)[1, 1])\n",
    "print(np.array(input_x).shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 定义模型流程图\n",
    "class TensorFlowDKT(object):\n",
    "    def __init__(self, config):\n",
    "        self.hidden_neurons = hidden_neurons = config[\"hidden_neurons\"]\n",
    "        self.num_skills = num_skills = config[\"num_skills\"]\n",
    "        self.input_size = input_size = config[\"input_size\"]\n",
    "        self.batch_size = batch_size = config[\"batch_size\"]\n",
    "        self.keep_prob_value = config[\"keep_prob\"]\n",
    "\n",
    "        self.max_steps = tf.placeholder(tf.int32)  # 当前batch中最大序列长度\n",
    "        self.input_data = tf.placeholder(tf.float32, [batch_size, None, input_size])\n",
    "        self.sequence_len = tf.placeholder(tf.int32, [batch_size])\n",
    "        self.keep_prob = tf.placeholder(tf.float32)  # dropout keep prob\n",
    "\n",
    "        self.target_id = tf.placeholder(tf.int32, [batch_size, None])\n",
    "        self.target_correctness = tf.placeholder(tf.float32, [batch_size, None])\n",
    "\n",
    "        # 构建lstm模型结构\n",
    "        hidden_layers = []\n",
    "        for idx, hidden_size in enumerate(hidden_neurons):\n",
    "            lstm_layer = tf.nn.rnn_cell.LSTMCell(num_units=hidden_size, state_is_tuple=True)\n",
    "            hidden_layer = tf.nn.rnn_cell.DropoutWrapper(cell=lstm_layer,\n",
    "                                                         output_keep_prob=self.keep_prob)\n",
    "            hidden_layers.append(hidden_layer)\n",
    "        self.hidden_cell = tf.nn.rnn_cell.MultiRNNCell(cells=hidden_layers, state_is_tuple=True)\n",
    "\n",
    "        # 采用动态rnn，动态输入序列的长度\n",
    "        outputs, self.current_state = tf.nn.dynamic_rnn(cell=self.hidden_cell,\n",
    "                                                             inputs=self.input_data,\n",
    "                                                             sequence_length=self.sequence_len,\n",
    "                                                             dtype=tf.float32)\n",
    "\n",
    "        # 隐层到输出层的权重系数[最后隐层的神经元数量，知识点数]\n",
    "        output_w = tf.get_variable(\"W\", [hidden_neurons[-1], num_skills])\n",
    "        output_b = tf.get_variable(\"b\", [num_skills])\n",
    "       \n",
    "        self.output = tf.reshape(outputs, [batch_size * self.max_steps, hidden_neurons[-1]])\n",
    "        # 因为权值共享的原因，对生成的矩阵[batch_size * self.max_steps, num_skills]中的每一行都加上b\n",
    "        self.logits = tf.matmul(self.output, output_w) + output_b\n",
    "\n",
    "        self.mat_logits = tf.reshape(self.logits, [batch_size, self.max_steps, num_skills])\n",
    "        # 对每个batch中每个序列中的每个时间点的输出中的每个值进行sigmoid计算，这里的值表示对某个知识点的掌握情况，\n",
    "        # 每个时间点都会输出对所有知识点的掌握情况\n",
    "        self.pred_all = tf.sigmoid(self.mat_logits)\n",
    "\n",
    "        # 计算损失loss\n",
    "        flat_logits = tf.reshape(self.logits, [-1])\n",
    "        \n",
    "        flat_target_correctness = tf.reshape(self.target_correctness, [-1])\n",
    "        \n",
    "        flat_base_target_index = tf.range(batch_size * self.max_steps) * num_skills\n",
    "        \n",
    "        # 因为flat_logits的长度为batch_size * num_steps * num_skills，我们要根据每一步的target_id将其长度变成batch_size * num_steps\n",
    "        flat_base_target_id = tf.reshape(self.target_id, [-1])\n",
    "        flat_base_target_correctness = tf.reshape(self.target_correctness, [-1]) * num_skills\n",
    "        \n",
    "        flat_target_id = flat_base_target_id + flat_base_target_index\n",
    "        # gather是从一个tensor中切片一个子集\n",
    "        flat_target_logits = tf.gather(flat_logits, flat_target_id)\n",
    "        \n",
    "        # 对切片后的数据进行sigmoid转换\n",
    "        self.pred = tf.sigmoid(tf.reshape(flat_target_logits, [batch_size, self.max_steps]))\n",
    "        # 将sigmoid后的值表示为0或1\n",
    "        self.binary_pred = tf.cast(tf.greater_equal(self.pred, 0.5), tf.int32)\n",
    "        self.loss = tf.reduce_sum(tf.nn.sigmoid_cross_entropy_with_logits(labels=flat_target_correctness,\n",
    "                                                                          logits=flat_target_logits))\n",
    "\n",
    "        self.lr = tf.Variable(0.0, trainable=False)\n",
    "        trainable_vars = tf.trainable_variables()\n",
    "        self.grads, _ = tf.clip_by_global_norm(tf.gradients(self.loss, trainable_vars), 4)\n",
    "\n",
    "        optimizer = tf.train.GradientDescentOptimizer(self.lr)\n",
    "        self.train_op = optimizer.apply_gradients(zip(self.grads, trainable_vars))\n",
    "\n",
    "    # step on batch\n",
    "    def step(self, sess, input_x, target_id, target_correctness, sequence_len, is_train):\n",
    "        _, max_steps, _ = input_x.shape\n",
    "        input_feed = {self.input_data: input_x,\n",
    "                      self.target_id: target_id,\n",
    "                      self.target_correctness: target_correctness,\n",
    "                      self.max_steps: max_steps,\n",
    "                      self.sequence_len: sequence_len}\n",
    "\n",
    "        if is_train:\n",
    "            input_feed[self.keep_prob] = self.keep_prob_value\n",
    "            train_loss, _, _ = sess.run([self.loss, self.train_op, self.current_state], input_feed)\n",
    "            return train_loss\n",
    "        else:\n",
    "            input_feed[self.keep_prob] = 1\n",
    "            bin_pred, pred, pred_all = sess.run([self.binary_pred, self.pred, self.pred_all], input_feed)\n",
    "            return bin_pred, pred, pred_all\n",
    "\n",
    "    def assign_lr(self, session, lr_value):\n",
    "        session.run(tf.assign(self.lr, lr_value))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 训练模型\n",
    "def run():\n",
    "    # process data\n",
    "    seqs_by_student, num_skills = read_file(\"./data/assistments.txt\")\n",
    "    train_seqs, test_seqs = split_dataset(seqs_by_student)\n",
    "    batch_size = 10\n",
    "    train_generator = DataGenerator(train_seqs, batch_size=batch_size, num_skills=num_skills)\n",
    "    test_generator = DataGenerator(test_seqs, batch_size=batch_size, num_skills=num_skills)\n",
    "\n",
    "    # config and create model\n",
    "    config = {\"hidden_neurons\": [200],\n",
    "              \"batch_size\": batch_size,\n",
    "              \"keep_prob\": 0.6,\n",
    "              \"num_skills\": num_skills,\n",
    "              \"input_size\": num_skills * 2}\n",
    "    model = TensorFlowDKT(config)\n",
    "\n",
    "    sess = tf.Session()\n",
    "    sess.run(tf.global_variables_initializer())\n",
    "    lr = 0.4\n",
    "    lr_decay = 0.92\n",
    "    # run epoch\n",
    "    for epoch in range(10):\n",
    "        # train\n",
    "        model.assign_lr(sess, lr * lr_decay ** epoch)\n",
    "        overall_loss = 0\n",
    "        train_generator.shuffle()\n",
    "        st = time.time()\n",
    "        while not train_generator.end:\n",
    "            input_x, target_id, target_correctness, seqs_len, max_len = train_generator.next_batch()\n",
    "            loss = model.step(sess, input_x, target_id, target_correctness, seqs_len, is_train=True)\n",
    "            print(\"\\r idx:{0}, loss:{1}, time spent:{2}s\".format(train_generator.pos, loss,\n",
    "                                                                         time.time() - st),\n",
    "            sys.stdout.flush())\n",
    "\n",
    "        # test\n",
    "        test_generator.reset()\n",
    "        preds, binary_preds, targets = list(), list(), list()\n",
    "        while not test_generator.end:\n",
    "            input_x, target_id, target_correctness, seqs_len, max_len = test_generator.next_batch()\n",
    "            binary_pred, pred, _ = model.step(sess, input_x, target_id, target_correctness, seqs_len, is_train=False)\n",
    "            for seq_idx, seq_len in enumerate(seqs_len):\n",
    "                preds.append(pred[seq_idx, 0:seq_len])\n",
    "                binary_preds.append(binary_pred[seq_idx, 0:seq_len])\n",
    "                targets.append(target_correctness[seq_idx, 0:seq_len])\n",
    "        # compute metrics\n",
    "        preds = np.concatenate(preds)\n",
    "        print(preds.shape)\n",
    "        binary_preds = np.concatenate(binary_preds)\n",
    "        print(binary_preds.shape)\n",
    "        targets = np.concatenate(targets)\n",
    "        print(targets.shape)\n",
    "        auc_value = roc_auc_score(targets, preds)\n",
    "        accuracy = accuracy_score(targets, binary_preds)\n",
    "        precision, recall, f_score, _ = precision_recall_fscore_support(targets, binary_preds)\n",
    "        print(\"\\n auc={0}, accuracy={1}, precision={2}, recall={3}\".format(auc_value, accuracy, precision, recall))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/jiangxinyang848/anaconda3/envs/jiang/lib/python3.5/site-packages/tensorflow/python/ops/gradients_impl.py:96: UserWarning: Converting sparse IndexedSlices to a dense Tensor of unknown shape. This may consume a large amount of memory.\n",
      "  \"Converting sparse IndexedSlices to a dense Tensor of unknown shape. \"\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " idx:10, loss:6411.697265625, time spent:1.2386512756347656s None\n",
      " idx:20, loss:2296.4375, time spent:2.053205728530884s None\n",
      " idx:30, loss:1869.512451171875, time spent:2.956787109375s None\n",
      " idx:40, loss:804.0730590820312, time spent:3.232927083969116s None\n",
      " idx:50, loss:1128.8704833984375, time spent:3.7211825847625732s None\n",
      " idx:60, loss:694.512939453125, time spent:3.969052791595459s None\n",
      " idx:70, loss:384.28076171875, time spent:4.200042247772217s None\n",
      " idx:80, loss:552.7459716796875, time spent:4.487602472305298s None\n",
      " idx:90, loss:768.07373046875, time spent:4.9169793128967285s None\n",
      " idx:100, loss:730.6004638671875, time spent:5.616422653198242s None\n",
      " idx:110, loss:350.6320495605469, time spent:5.7621355056762695s None\n",
      " idx:120, loss:412.0313415527344, time spent:6.129215478897095s None\n",
      " idx:130, loss:430.2217102050781, time spent:6.407047748565674s None\n",
      " idx:140, loss:373.2222595214844, time spent:6.646601676940918s None\n",
      " idx:150, loss:714.2084350585938, time spent:7.182559013366699s None\n",
      " idx:160, loss:643.7447509765625, time spent:7.664224624633789s None\n",
      " idx:170, loss:591.9671630859375, time spent:8.116303443908691s None\n",
      " idx:180, loss:1787.9716796875, time spent:9.135922908782959s None\n",
      " idx:190, loss:435.42266845703125, time spent:9.304121494293213s None\n",
      " idx:200, loss:253.30078125, time spent:9.50136423110962s None\n",
      " idx:210, loss:1245.80859375, time spent:10.21423077583313s None\n",
      " idx:220, loss:369.52752685546875, time spent:10.49631643295288s None\n",
      " idx:230, loss:170.847900390625, time spent:10.60465693473816s None\n",
      " idx:240, loss:203.95266723632812, time spent:10.717092990875244s None\n",
      " idx:250, loss:227.10772705078125, time spent:10.904676675796509s None\n",
      " idx:260, loss:186.318359375, time spent:11.008126497268677s None\n",
      " idx:270, loss:351.04266357421875, time spent:11.318676471710205s None\n",
      " idx:280, loss:915.1209106445312, time spent:12.08403491973877s None\n",
      " idx:290, loss:962.5549926757812, time spent:12.946320533752441s None\n",
      " idx:300, loss:593.7300415039062, time spent:13.219354629516602s None\n",
      " idx:310, loss:777.419189453125, time spent:13.728586912155151s None\n",
      " idx:320, loss:196.11932373046875, time spent:13.848841667175293s None\n",
      " idx:330, loss:1842.478515625, time spent:14.516544103622437s None\n",
      " idx:340, loss:788.7222900390625, time spent:15.419556856155396s None\n",
      " idx:350, loss:1750.7435302734375, time spent:16.559279918670654s None\n",
      " idx:360, loss:261.5328369140625, time spent:16.64382815361023s None\n",
      " idx:370, loss:1116.9482421875, time spent:17.410869359970093s None\n",
      " idx:380, loss:219.88885498046875, time spent:17.636343002319336s None\n",
      " idx:390, loss:414.7312316894531, time spent:17.834973096847534s None\n",
      " idx:400, loss:726.7392578125, time spent:18.50076150894165s None\n",
      " idx:410, loss:71.68597412109375, time spent:18.530853271484375s None\n",
      " idx:420, loss:350.1238098144531, time spent:18.730499505996704s None\n",
      " idx:430, loss:1312.125732421875, time spent:19.727938652038574s None\n",
      " idx:440, loss:155.27432250976562, time spent:19.82474970817566s None\n",
      " idx:450, loss:973.1036987304688, time spent:20.689671277999878s None\n",
      " idx:460, loss:256.7085876464844, time spent:20.797781229019165s None\n",
      " idx:470, loss:293.6612243652344, time spent:20.909151792526245s None\n",
      " idx:480, loss:165.85401916503906, time spent:20.993069410324097s None\n",
      " idx:490, loss:889.0831298828125, time spent:21.79749035835266s None\n",
      " idx:500, loss:1587.66357421875, time spent:22.80166983604431s None\n",
      " idx:510, loss:1750.2076416015625, time spent:23.86359691619873s None\n",
      " idx:520, loss:560.6871337890625, time spent:24.626551866531372s None\n",
      " idx:530, loss:564.604248046875, time spent:25.45609402656555s None\n",
      " idx:540, loss:801.9458618164062, time spent:25.964198350906372s None\n",
      " idx:550, loss:1114.807861328125, time spent:26.744481563568115s None\n",
      " idx:560, loss:175.17959594726562, time spent:26.81666350364685s None\n",
      " idx:570, loss:467.0615234375, time spent:27.06102728843689s None\n",
      " idx:580, loss:286.17333984375, time spent:27.237454175949097s None\n",
      " idx:590, loss:750.1013793945312, time spent:27.53549575805664s None\n",
      " idx:600, loss:389.1239929199219, time spent:27.795698404312134s None\n",
      " idx:610, loss:1193.97021484375, time spent:28.614331483840942s None\n",
      " idx:620, loss:439.39752197265625, time spent:28.871045351028442s None\n",
      " idx:630, loss:1438.3538818359375, time spent:30.31130027770996s None\n",
      " idx:640, loss:876.66552734375, time spent:30.788895845413208s None\n",
      " idx:650, loss:532.8153686523438, time spent:31.39309597015381s None\n",
      " idx:660, loss:232.93978881835938, time spent:31.556591272354126s None\n",
      " idx:670, loss:348.07818603515625, time spent:33.119438886642456s None\n",
      " idx:680, loss:269.8285217285156, time spent:33.27286624908447s None\n",
      " idx:690, loss:1082.8798828125, time spent:34.28834104537964s None\n",
      " idx:700, loss:673.26171875, time spent:35.51866602897644s None\n",
      " idx:710, loss:1114.943359375, time spent:36.15080451965332s None\n",
      " idx:720, loss:268.9786071777344, time spent:36.27325463294983s None\n",
      " idx:730, loss:748.2847900390625, time spent:37.26217818260193s None\n",
      " idx:740, loss:572.78271484375, time spent:38.031094551086426s None\n",
      " idx:750, loss:1190.6983642578125, time spent:39.18365144729614s None\n",
      " idx:760, loss:650.0399780273438, time spent:39.70848608016968s None\n",
      " idx:770, loss:477.20379638671875, time spent:39.983587980270386s None\n",
      " idx:780, loss:771.4902954101562, time spent:40.44524621963501s None\n",
      " idx:790, loss:1306.0400390625, time spent:41.18470597267151s None\n",
      " idx:800, loss:818.0523681640625, time spent:41.609694957733154s None\n",
      " idx:810, loss:442.1344299316406, time spent:41.810861110687256s None\n",
      " idx:820, loss:1718.190673828125, time spent:43.03806662559509s None\n",
      " idx:830, loss:2174.08447265625, time spent:45.346904039382935s None\n",
      " idx:840, loss:699.5537719726562, time spent:46.00409412384033s None\n",
      " idx:850, loss:234.05227661132812, time spent:46.17860174179077s None\n",
      " idx:860, loss:1538.4974365234375, time spent:47.476550340652466s None\n",
      " idx:870, loss:262.6285400390625, time spent:47.643620014190674s None\n",
      " idx:880, loss:806.309814453125, time spent:48.593579053878784s None\n",
      " idx:890, loss:463.85528564453125, time spent:49.078808069229126s None\n",
      " idx:900, loss:246.89395141601562, time spent:49.20936179161072s None\n",
      " idx:910, loss:1715.015380859375, time spent:50.32112121582031s None\n",
      " idx:920, loss:565.6578369140625, time spent:50.51354479789734s None\n",
      " idx:930, loss:358.44189453125, time spent:50.74913787841797s None\n",
      " idx:940, loss:152.34567260742188, time spent:50.842448234558105s None\n",
      " idx:950, loss:318.9923095703125, time spent:51.69627857208252s None\n",
      " idx:960, loss:1087.9339599609375, time spent:52.942874908447266s None\n",
      " idx:970, loss:548.079345703125, time spent:53.851927757263184s None\n",
      " idx:980, loss:350.3607482910156, time spent:54.019200801849365s None\n",
      " idx:990, loss:903.568603515625, time spent:54.79021716117859s None\n",
      " idx:1000, loss:1756.7742919921875, time spent:55.885119915008545s None\n",
      " idx:1010, loss:209.00901794433594, time spent:56.05567479133606s None\n",
      " idx:1020, loss:645.0108032226562, time spent:57.32662057876587s None\n",
      " idx:1030, loss:380.3542175292969, time spent:57.52714967727661s None\n",
      " idx:1040, loss:451.6650390625, time spent:59.350812911987305s None\n",
      " idx:1050, loss:582.4793090820312, time spent:59.724387645721436s None\n",
      " idx:1060, loss:259.278564453125, time spent:59.925405979156494s None\n",
      " idx:1070, loss:740.8201904296875, time spent:60.49659609794617s None\n",
      " idx:1080, loss:79.74596405029297, time spent:60.53346133232117s None\n",
      " idx:1090, loss:636.7588500976562, time spent:61.28564786911011s None\n",
      " idx:1100, loss:474.22650146484375, time spent:61.51868033409119s None\n",
      " idx:1110, loss:109.13750457763672, time spent:61.5659544467926s None\n",
      " idx:1120, loss:545.3914184570312, time spent:61.76100134849548s None\n",
      " idx:1130, loss:1620.2371826171875, time spent:63.90669107437134s None\n",
      " idx:1140, loss:1511.747314453125, time spent:64.8869161605835s None\n",
      " idx:1150, loss:416.84039306640625, time spent:65.05401468276978s None\n",
      " idx:1160, loss:133.58143615722656, time spent:65.09661865234375s None\n",
      " idx:1170, loss:183.02845764160156, time spent:65.18721723556519s None\n",
      " idx:1180, loss:926.084228515625, time spent:65.8097972869873s None\n",
      " idx:1190, loss:640.7008056640625, time spent:66.68975186347961s None\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " idx:1200, loss:410.6839904785156, time spent:66.99108290672302s None\n",
      " idx:1210, loss:768.4559326171875, time spent:67.6207480430603s None\n",
      " idx:1220, loss:399.8243103027344, time spent:68.40451049804688s None\n",
      " idx:1230, loss:228.4388885498047, time spent:68.55985689163208s None\n",
      " idx:1240, loss:842.420654296875, time spent:69.45628333091736s None\n",
      " idx:1250, loss:177.9541473388672, time spent:69.54384875297546s None\n",
      " idx:1260, loss:598.5245361328125, time spent:70.34012198448181s None\n",
      " idx:1270, loss:245.306640625, time spent:70.5792396068573s None\n",
      " idx:1280, loss:265.4898681640625, time spent:70.684410572052s None\n",
      " idx:1290, loss:618.1990966796875, time spent:71.21656918525696s None\n",
      " idx:1300, loss:712.2733764648438, time spent:71.75980758666992s None\n",
      " idx:1310, loss:1849.6370849609375, time spent:72.62880754470825s None\n",
      " idx:1320, loss:255.61744689941406, time spent:72.8344783782959s None\n",
      " idx:1330, loss:1239.06787109375, time spent:73.73756980895996s None\n",
      " idx:1340, loss:444.1165771484375, time spent:74.15295100212097s None\n",
      " idx:1350, loss:2215.985595703125, time spent:75.13546919822693s None\n",
      " idx:1360, loss:596.6815795898438, time spent:75.47885847091675s None\n",
      " idx:1370, loss:269.3514404296875, time spent:75.73018431663513s None\n",
      " idx:1380, loss:630.9527587890625, time spent:76.23805332183838s None\n",
      " idx:1390, loss:1058.0511474609375, time spent:76.69777822494507s None\n",
      " idx:1400, loss:831.989013671875, time spent:77.13955402374268s None\n",
      " idx:1410, loss:317.197021484375, time spent:77.31367349624634s None\n",
      " idx:1420, loss:205.63987731933594, time spent:77.49533796310425s None\n",
      " idx:1430, loss:406.3879699707031, time spent:77.80951595306396s None\n",
      " idx:1440, loss:387.47747802734375, time spent:79.04547142982483s None\n",
      " idx:1450, loss:245.37127685546875, time spent:79.20134210586548s None\n",
      " idx:1460, loss:1613.96484375, time spent:80.56288766860962s None\n",
      " idx:1470, loss:341.6475524902344, time spent:80.79710578918457s None\n",
      " idx:1480, loss:480.481689453125, time spent:81.14246869087219s None\n",
      " idx:1490, loss:728.5596923828125, time spent:81.91930079460144s None\n",
      " idx:1500, loss:1147.4609375, time spent:82.59833717346191s None\n",
      " idx:1510, loss:3421.2509765625, time spent:89.69401931762695s None\n",
      " idx:1520, loss:699.176513671875, time spent:90.5167908668518s None\n",
      " idx:1530, loss:889.0279541015625, time spent:91.38296151161194s None\n",
      " idx:1540, loss:92.12315368652344, time spent:91.44085502624512s None\n",
      " idx:1550, loss:1378.854248046875, time spent:92.37355661392212s None\n",
      " idx:1560, loss:700.2367553710938, time spent:92.61013221740723s None\n",
      " idx:1570, loss:292.2436218261719, time spent:92.73482537269592s None\n",
      " idx:1580, loss:534.9434204101562, time spent:93.46389079093933s None\n",
      " idx:1590, loss:629.7047119140625, time spent:94.74392175674438s None\n",
      " idx:1600, loss:356.322021484375, time spent:95.02114200592041s None\n",
      " idx:1610, loss:430.43267822265625, time spent:97.34505486488342s None\n",
      " idx:1620, loss:995.6655883789062, time spent:98.29732131958008s None\n",
      " idx:1630, loss:608.86181640625, time spent:98.67691445350647s None\n",
      " idx:1640, loss:1646.683349609375, time spent:100.14253306388855s None\n",
      " idx:1650, loss:754.4869995117188, time spent:100.71706891059875s None\n",
      " idx:1660, loss:1377.249267578125, time spent:101.75665402412415s None\n",
      " idx:1670, loss:454.8898010253906, time spent:101.96484875679016s None\n",
      " idx:1680, loss:617.0687866210938, time spent:102.62959742546082s None\n",
      " idx:1690, loss:884.486572265625, time spent:103.20993757247925s None\n",
      " idx:1700, loss:284.33746337890625, time spent:103.36849522590637s None\n",
      " idx:1710, loss:220.1256561279297, time spent:103.53381013870239s None\n",
      " idx:1720, loss:517.3207397460938, time spent:103.75903511047363s None\n",
      " idx:1730, loss:264.2737731933594, time spent:103.99554681777954s None\n",
      " idx:1740, loss:88.27455139160156, time spent:104.03881168365479s None\n",
      " idx:1750, loss:293.7584228515625, time spent:104.23368883132935s None\n",
      " idx:1760, loss:656.6267700195312, time spent:104.70887994766235s None\n",
      " idx:1770, loss:1658.96240234375, time spent:105.80786371231079s None\n",
      " idx:1780, loss:318.11895751953125, time spent:106.12519979476929s None\n",
      " idx:1790, loss:218.7412109375, time spent:106.19677710533142s None\n",
      " idx:1800, loss:217.80618286132812, time spent:106.4362006187439s None\n",
      " idx:1810, loss:709.0125732421875, time spent:107.2029972076416s None\n",
      " idx:1820, loss:1368.364990234375, time spent:108.3848602771759s None\n",
      " idx:1830, loss:1237.016357421875, time spent:109.23854970932007s None\n",
      " idx:1840, loss:775.4109497070312, time spent:109.82251954078674s None\n",
      " idx:1850, loss:1205.6739501953125, time spent:110.90594363212585s None\n",
      " idx:1860, loss:1753.6441650390625, time spent:112.37143468856812s None\n",
      " idx:1870, loss:321.4839172363281, time spent:112.64721179008484s None\n",
      " idx:1880, loss:502.63671875, time spent:112.88207006454468s None\n",
      " idx:1890, loss:746.5573120117188, time spent:113.17292261123657s None\n",
      " idx:1900, loss:257.56231689453125, time spent:113.26769638061523s None\n",
      " idx:1910, loss:802.70703125, time spent:114.04259967803955s None\n",
      " idx:1920, loss:1157.233642578125, time spent:114.9714834690094s None\n",
      " idx:1930, loss:560.4515380859375, time spent:115.42152428627014s None\n",
      " idx:1940, loss:1111.505615234375, time spent:116.42591762542725s None\n",
      " idx:1950, loss:175.06301879882812, time spent:116.54802298545837s None\n",
      " idx:1960, loss:389.12518310546875, time spent:117.78578996658325s None\n",
      " idx:1970, loss:1107.01708984375, time spent:118.65798950195312s None\n",
      " idx:1980, loss:578.2462158203125, time spent:119.24666976928711s None\n",
      " idx:1990, loss:401.6044006347656, time spent:120.52225923538208s None\n",
      " idx:2000, loss:286.3847961425781, time spent:120.70236325263977s None\n",
      " idx:2010, loss:520.8521728515625, time spent:121.40216612815857s None\n",
      " idx:2020, loss:400.2196044921875, time spent:121.68401980400085s None\n",
      " idx:2030, loss:219.35140991210938, time spent:121.9307770729065s None\n",
      " idx:2040, loss:697.094970703125, time spent:122.26555871963501s None\n",
      " idx:2050, loss:639.052001953125, time spent:122.8647940158844s None\n",
      " idx:2060, loss:520.717041015625, time spent:123.92454743385315s None\n",
      " idx:2070, loss:639.2383422851562, time spent:124.61387491226196s None\n",
      " idx:2080, loss:256.7503662109375, time spent:124.80829691886902s None\n",
      " idx:2090, loss:2097.9375, time spent:127.45629501342773s None\n",
      " idx:2100, loss:1025.9130859375, time spent:128.25224256515503s None\n",
      " idx:2110, loss:638.3622436523438, time spent:128.97422075271606s None\n",
      " idx:2120, loss:1021.1505737304688, time spent:130.0501081943512s None\n",
      " idx:2130, loss:453.9121398925781, time spent:130.9486527442932s None\n",
      " idx:2140, loss:334.8025817871094, time spent:131.5798749923706s None\n",
      " idx:2150, loss:856.6017456054688, time spent:132.0939438343048s None\n",
      " idx:2160, loss:767.2183227539062, time spent:132.6624789237976s None\n",
      " idx:2170, loss:356.9118347167969, time spent:132.93131303787231s None\n",
      " idx:2180, loss:1268.78662109375, time spent:133.68329215049744s None\n",
      " idx:2190, loss:285.7529602050781, time spent:134.06198477745056s None\n",
      " idx:2200, loss:1060.7412109375, time spent:135.37263417243958s None\n",
      " idx:2210, loss:278.7418212890625, time spent:135.5736141204834s None\n",
      " idx:2220, loss:940.2866821289062, time spent:136.20746231079102s None\n",
      " idx:2230, loss:257.2004699707031, time spent:136.3479344844818s None\n",
      " idx:2240, loss:579.3364868164062, time spent:137.11100602149963s None\n",
      " idx:2250, loss:693.3392333984375, time spent:137.4827365875244s None\n",
      " idx:2260, loss:537.2820434570312, time spent:137.9939136505127s None\n",
      " idx:2270, loss:204.11666870117188, time spent:138.12210965156555s None\n",
      " idx:2280, loss:926.0718994140625, time spent:138.97132563591003s None\n",
      " idx:2290, loss:134.93310546875, time spent:139.02473855018616s None\n",
      " idx:2300, loss:1157.0184326171875, time spent:139.96704030036926s None\n",
      " idx:2310, loss:249.1673583984375, time spent:140.06980109214783s None\n",
      " idx:2320, loss:298.90350341796875, time spent:140.22146701812744s None\n",
      " idx:2330, loss:347.37841796875, time spent:140.39110207557678s None\n",
      " idx:2340, loss:684.199951171875, time spent:141.12796354293823s None\n",
      " idx:2350, loss:526.04931640625, time spent:141.72624921798706s None\n",
      " idx:2360, loss:282.5785827636719, time spent:141.812424659729s None\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " idx:2370, loss:261.5081787109375, time spent:142.74173140525818s None\n",
      " idx:2380, loss:801.0623779296875, time spent:143.20153522491455s None\n",
      " idx:2390, loss:397.4521789550781, time spent:143.46886467933655s None\n",
      " idx:2400, loss:514.7828979492188, time spent:143.77644896507263s None\n",
      " idx:2410, loss:283.4164733886719, time spent:143.92335081100464s None\n",
      " idx:2420, loss:753.822509765625, time spent:144.59182476997375s None\n",
      " idx:2430, loss:711.7578125, time spent:145.3080449104309s None\n",
      " idx:2440, loss:233.35134887695312, time spent:145.38576292991638s None\n",
      " idx:2450, loss:1170.473876953125, time spent:145.90797472000122s None\n",
      " idx:2460, loss:473.2379455566406, time spent:146.94353222846985s None\n",
      " idx:2470, loss:601.5134887695312, time spent:147.56432175636292s None\n",
      " idx:2480, loss:204.04148864746094, time spent:147.68128275871277s None\n",
      " idx:2490, loss:292.52874755859375, time spent:147.81913590431213s None\n",
      " idx:2500, loss:924.77734375, time spent:148.48419284820557s None\n",
      " idx:2510, loss:242.3153839111328, time spent:148.71293878555298s None\n",
      " idx:2520, loss:839.7835693359375, time spent:149.50482845306396s None\n",
      " idx:2530, loss:2275.87109375, time spent:154.21785354614258s None\n",
      " idx:2540, loss:1752.26025390625, time spent:155.09705209732056s None\n",
      " idx:2550, loss:644.2548217773438, time spent:155.7802858352661s None\n",
      " idx:2560, loss:515.488037109375, time spent:156.38921475410461s None\n",
      " idx:2570, loss:367.99615478515625, time spent:156.58400774002075s None\n",
      " idx:2580, loss:1467.16845703125, time spent:157.46679043769836s None\n",
      " idx:2590, loss:456.9724426269531, time spent:157.83385586738586s None\n",
      " idx:2600, loss:347.5085144042969, time spent:158.02468991279602s None\n",
      " idx:2610, loss:877.118408203125, time spent:158.58596968650818s None\n",
      " idx:2620, loss:574.9087524414062, time spent:159.31367087364197s None\n",
      " idx:2630, loss:1066.1859130859375, time spent:160.37504482269287s None\n",
      " idx:2640, loss:667.7313842773438, time spent:161.04754519462585s None\n",
      " idx:2650, loss:452.7418212890625, time spent:161.4113278388977s None\n",
      " idx:2660, loss:235.25445556640625, time spent:161.5352954864502s None\n",
      " idx:2670, loss:395.79034423828125, time spent:161.78870487213135s None\n",
      " idx:2680, loss:514.4100341796875, time spent:162.39460802078247s None\n",
      " idx:2690, loss:393.938232421875, time spent:162.54409861564636s None\n",
      " idx:2700, loss:1091.0299072265625, time spent:163.54631543159485s None\n",
      " idx:2710, loss:370.336181640625, time spent:163.70116806030273s None\n",
      " idx:2720, loss:292.65228271484375, time spent:163.85892033576965s None\n",
      " idx:2730, loss:417.7104797363281, time spent:164.17974376678467s None\n",
      " idx:2740, loss:194.81777954101562, time spent:164.35225987434387s None\n",
      " idx:2750, loss:584.9613037109375, time spent:164.6139566898346s None\n",
      " idx:2760, loss:185.51449584960938, time spent:164.6774251461029s None\n",
      " idx:2770, loss:358.8902893066406, time spent:165.72982931137085s None\n",
      " idx:2780, loss:187.82431030273438, time spent:166.4695987701416s None\n",
      " idx:2790, loss:472.32037353515625, time spent:166.71934056282043s None\n",
      " idx:2800, loss:1512.2596435546875, time spent:167.49276447296143s None\n",
      " idx:2810, loss:237.61492919921875, time spent:167.61922574043274s None\n",
      " idx:2820, loss:292.6458740234375, time spent:168.67481994628906s None\n",
      " idx:2830, loss:1502.978759765625, time spent:169.4499933719635s None\n",
      " idx:2840, loss:303.0196228027344, time spent:169.73893070220947s None\n",
      " idx:2850, loss:562.6783447265625, time spent:170.40991377830505s None\n",
      " idx:2860, loss:395.54010009765625, time spent:171.81988382339478s None\n",
      " idx:2870, loss:287.68560791015625, time spent:172.05200338363647s None\n",
      " idx:2880, loss:219.69476318359375, time spent:172.16242218017578s None\n",
      " idx:2890, loss:395.7484130859375, time spent:172.39763808250427s None\n",
      " idx:2900, loss:967.44384765625, time spent:173.2278711795807s None\n",
      " idx:2910, loss:297.0959167480469, time spent:173.42841911315918s None\n",
      " idx:2920, loss:203.1792449951172, time spent:173.54327058792114s None\n",
      " idx:2930, loss:622.3858032226562, time spent:173.89443254470825s None\n",
      " idx:2940, loss:685.8922119140625, time spent:174.75116062164307s None\n",
      " idx:2950, loss:610.5366821289062, time spent:175.39541840553284s None\n",
      " idx:2960, loss:161.46578979492188, time spent:175.46245741844177s None\n",
      " idx:2970, loss:550.35205078125, time spent:175.90407705307007s None\n",
      " idx:2980, loss:943.4774169921875, time spent:176.83164620399475s None\n",
      " idx:2990, loss:437.2881164550781, time spent:177.07530903816223s None\n",
      " idx:3000, loss:157.75497436523438, time spent:177.18563318252563s None\n",
      " idx:3010, loss:231.9415283203125, time spent:177.26851201057434s None\n",
      " idx:3020, loss:710.3606567382812, time spent:177.62898993492126s None\n",
      " idx:3030, loss:240.92166137695312, time spent:177.8205394744873s None\n",
      " idx:3040, loss:274.69183349609375, time spent:178.07268476486206s None\n",
      " idx:3050, loss:218.86900329589844, time spent:178.26695823669434s None\n",
      " idx:3060, loss:418.02301025390625, time spent:178.46378755569458s None\n",
      " idx:3070, loss:492.8860168457031, time spent:179.0556995868683s None\n",
      " idx:3080, loss:878.9664916992188, time spent:179.8099398612976s None\n",
      " idx:3090, loss:724.1303100585938, time spent:180.21294498443604s None\n",
      " idx:3100, loss:344.64056396484375, time spent:181.07228136062622s None\n",
      " idx:3110, loss:691.0372924804688, time spent:181.750141620636s None\n",
      " idx:3120, loss:1178.51318359375, time spent:182.51759815216064s None\n",
      " idx:3130, loss:457.7332763671875, time spent:182.79886651039124s None\n",
      " idx:3140, loss:258.49578857421875, time spent:182.96442127227783s None\n",
      " idx:3150, loss:214.20802307128906, time spent:183.01804327964783s None\n",
      " idx:3160, loss:917.6752319335938, time spent:184.038414478302s None\n",
      " idx:3170, loss:209.24090576171875, time spent:184.29864645004272s None\n",
      " idx:3180, loss:244.53958129882812, time spent:184.41311168670654s None\n",
      " idx:3190, loss:522.2525634765625, time spent:185.28022050857544s None\n",
      " idx:3200, loss:325.85101318359375, time spent:185.41939210891724s None\n",
      " idx:3210, loss:288.03912353515625, time spent:186.3471326828003s None\n",
      " idx:3220, loss:319.9466247558594, time spent:186.551442861557s None\n",
      " idx:3230, loss:499.28399658203125, time spent:188.13719058036804s None\n",
      " idx:3240, loss:413.76031494140625, time spent:188.35382533073425s None\n",
      " idx:3250, loss:724.228271484375, time spent:189.15979671478271s None\n",
      " idx:3260, loss:236.88002014160156, time spent:189.61014652252197s None\n",
      " idx:3270, loss:293.1194763183594, time spent:190.68711972236633s None\n",
      " idx:3280, loss:287.8678894042969, time spent:190.8013083934784s None\n",
      " idx:3290, loss:1056.087646484375, time spent:191.80083346366882s None\n",
      " idx:3300, loss:253.10165405273438, time spent:192.02291321754456s None\n",
      " idx:3310, loss:495.33831787109375, time spent:192.24508547782898s None\n",
      " idx:3320, loss:264.9685974121094, time spent:192.41837882995605s None\n",
      " idx:3330, loss:315.8204040527344, time spent:193.12799263000488s None\n",
      " idx:3340, loss:228.6646728515625, time spent:193.25669074058533s None\n",
      " idx:3350, loss:230.66995239257812, time spent:193.4206690788269s None\n",
      " idx:3360, loss:782.2093505859375, time spent:194.52420735359192s None\n",
      " idx:3370, loss:1201.6038818359375, time spent:195.42627573013306s None\n",
      " idx:3373, loss:648.8162841796875, time spent:196.0640354156494s None\n",
      "(101508,)\n",
      "(101508,)\n",
      "(101508,)\n",
      "\n",
      " auc=0.8095467336396546, accuracy=0.7647574575402923, precision=[ 0.74707324  0.76866363], recall=[ 0.41633793  0.9322432 ]\n",
      " idx:10, loss:397.99749755859375, time spent:0.2962987422943115s None\n",
      " idx:20, loss:223.0215606689453, time spent:0.41999030113220215s None\n",
      " idx:30, loss:237.86505126953125, time spent:0.5199544429779053s None\n",
      " idx:40, loss:533.814208984375, time spent:1.6447293758392334s None\n",
      " idx:50, loss:414.178466796875, time spent:2.561408519744873s None\n",
      " idx:60, loss:737.9483032226562, time spent:2.8594412803649902s None\n",
      " idx:70, loss:266.8562316894531, time spent:2.999896764755249s None\n",
      " idx:80, loss:1063.2373046875, time spent:3.4636034965515137s None\n",
      " idx:90, loss:553.140380859375, time spent:4.017068862915039s None\n",
      " idx:100, loss:817.3846435546875, time spent:4.808492660522461s None\n",
      " idx:110, loss:111.71686553955078, time spent:4.867475986480713s None\n",
      " idx:120, loss:288.9644775390625, time spent:5.999070882797241s None\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " idx:130, loss:519.2550048828125, time spent:6.281514883041382s None\n",
      " idx:140, loss:246.31854248046875, time spent:6.562132835388184s None\n",
      " idx:150, loss:725.597412109375, time spent:7.282762289047241s None\n",
      " idx:160, loss:314.1200256347656, time spent:7.412705898284912s None\n",
      " idx:170, loss:638.5130615234375, time spent:8.403774738311768s None\n",
      " idx:180, loss:185.73922729492188, time spent:8.476576805114746s None\n",
      " idx:190, loss:446.99151611328125, time spent:8.800638198852539s None\n",
      " idx:200, loss:899.3628540039062, time spent:9.67365288734436s None\n",
      " idx:210, loss:1792.068359375, time spent:11.061240911483765s None\n",
      " idx:220, loss:1046.73828125, time spent:15.521221399307251s None\n",
      " idx:230, loss:615.936279296875, time spent:15.903348922729492s None\n",
      " idx:240, loss:1120.833740234375, time spent:16.607744932174683s None\n",
      " idx:250, loss:436.341796875, time spent:17.66783356666565s None\n",
      " idx:260, loss:1072.687255859375, time spent:18.462368726730347s None\n",
      " idx:270, loss:1021.2777709960938, time spent:18.995020627975464s None\n",
      " idx:280, loss:275.2795104980469, time spent:20.15323805809021s None\n",
      " idx:290, loss:442.251708984375, time spent:20.352992057800293s None\n",
      " idx:300, loss:532.525390625, time spent:20.513065099716187s None\n",
      " idx:310, loss:343.2457580566406, time spent:20.70433020591736s None\n",
      " idx:320, loss:397.7802429199219, time spent:20.961772918701172s None\n",
      " idx:330, loss:198.71160888671875, time spent:21.092583179473877s None\n",
      " idx:340, loss:237.61517333984375, time spent:22.121862173080444s None\n",
      " idx:350, loss:1277.395751953125, time spent:22.983967065811157s None\n",
      " idx:360, loss:895.8749389648438, time spent:23.57593274116516s None\n",
      " idx:370, loss:426.4222106933594, time spent:23.895068883895874s None\n",
      " idx:380, loss:287.1299743652344, time spent:24.04564619064331s None\n",
      " idx:390, loss:246.9225616455078, time spent:24.15799045562744s None\n",
      " idx:400, loss:940.9334716796875, time spent:24.75725555419922s None\n",
      " idx:410, loss:1277.0626220703125, time spent:26.065733909606934s None\n",
      " idx:420, loss:1766.427978515625, time spent:26.875457525253296s None\n",
      " idx:430, loss:143.44485473632812, time spent:27.465346574783325s None\n",
      " idx:440, loss:245.47662353515625, time spent:27.692908763885498s None\n",
      " idx:450, loss:309.6646728515625, time spent:27.819619178771973s None\n",
      " idx:460, loss:385.3885192871094, time spent:27.99078869819641s None\n",
      " idx:470, loss:194.09030151367188, time spent:28.14066243171692s None\n",
      " idx:480, loss:607.0270385742188, time spent:28.451130867004395s None\n",
      " idx:490, loss:600.3429565429688, time spent:28.814971923828125s None\n",
      " idx:500, loss:605.0833740234375, time spent:29.330829858779907s None\n",
      " idx:510, loss:191.51602172851562, time spent:29.442940950393677s None\n",
      " idx:520, loss:158.11227416992188, time spent:29.575798511505127s None\n",
      " idx:530, loss:289.40911865234375, time spent:31.044292211532593s None\n",
      " idx:540, loss:205.3543701171875, time spent:31.3232102394104s None\n",
      " idx:550, loss:944.682861328125, time spent:32.2339243888855s None\n",
      " idx:560, loss:1043.795166015625, time spent:33.55925989151001s None\n",
      " idx:570, loss:599.8466796875, time spent:34.14689660072327s None\n",
      " idx:580, loss:1496.4951171875, time spent:35.44601583480835s None\n",
      " idx:590, loss:408.9306335449219, time spent:35.75769305229187s None\n",
      " idx:600, loss:786.6212768554688, time spent:36.56617069244385s None\n",
      " idx:610, loss:258.3883056640625, time spent:36.701815605163574s None\n",
      " idx:620, loss:653.145263671875, time spent:37.35405683517456s None\n",
      " idx:630, loss:2645.944091796875, time spent:44.30309057235718s None\n",
      " idx:640, loss:570.0999145507812, time spent:44.863054513931274s None\n",
      " idx:650, loss:700.6344604492188, time spent:45.48094892501831s None\n",
      " idx:660, loss:978.4232177734375, time spent:46.53388023376465s None\n",
      " idx:670, loss:502.8365783691406, time spent:46.85101079940796s None\n",
      " idx:680, loss:769.819580078125, time spent:47.580583572387695s None\n",
      " idx:690, loss:474.61383056640625, time spent:48.197778940200806s None\n",
      " idx:700, loss:406.5489501953125, time spent:48.41318345069885s None\n",
      " idx:710, loss:695.8548583984375, time spent:49.314754486083984s None\n",
      " idx:720, loss:1406.8438720703125, time spent:50.52071285247803s None\n",
      " idx:730, loss:1250.525634765625, time spent:51.483612060546875s None\n",
      " idx:740, loss:271.940185546875, time spent:51.601242542266846s None\n",
      " idx:750, loss:614.769775390625, time spent:52.17983293533325s None\n",
      " idx:760, loss:983.8724365234375, time spent:52.99673080444336s None\n",
      " idx:770, loss:862.4921875, time spent:53.47750210762024s None\n",
      " idx:780, loss:401.37432861328125, time spent:53.680038928985596s None\n",
      " idx:790, loss:150.39784240722656, time spent:53.73367953300476s None\n",
      " idx:800, loss:1374.1669921875, time spent:54.85706353187561s None\n",
      " idx:810, loss:150.91070556640625, time spent:55.86631202697754s None\n",
      " idx:820, loss:429.8680419921875, time spent:56.08221435546875s None\n",
      " idx:830, loss:768.2972412109375, time spent:56.828315019607544s None\n",
      " idx:840, loss:409.9289245605469, time spent:57.22064161300659s None\n",
      " idx:850, loss:571.598388671875, time spent:58.000800371170044s None\n",
      " idx:860, loss:500.3652038574219, time spent:58.30799341201782s None\n",
      " idx:870, loss:862.664306640625, time spent:59.11566495895386s None\n",
      " idx:880, loss:681.559814453125, time spent:59.72792863845825s None\n",
      " idx:890, loss:502.6291809082031, time spent:60.760196685791016s None\n",
      " idx:900, loss:323.9266357421875, time spent:61.80995225906372s None\n",
      " idx:910, loss:468.665771484375, time spent:62.040404081344604s None\n",
      " idx:920, loss:169.03616333007812, time spent:62.09521412849426s None\n",
      " idx:930, loss:509.99627685546875, time spent:62.540600538253784s None\n",
      " idx:940, loss:82.33692169189453, time spent:62.57322120666504s None\n",
      " idx:950, loss:289.85076904296875, time spent:63.47137928009033s None\n",
      " idx:960, loss:622.3529052734375, time spent:64.23496341705322s None\n",
      " idx:970, loss:566.2415771484375, time spent:64.91618871688843s None\n",
      " idx:980, loss:544.7474975585938, time spent:65.3515555858612s None\n",
      " idx:990, loss:1041.7745361328125, time spent:66.36901354789734s None\n",
      " idx:1000, loss:194.0205078125, time spent:66.46843433380127s None\n",
      " idx:1010, loss:1026.26904296875, time spent:67.27030611038208s None\n",
      " idx:1020, loss:298.2328796386719, time spent:67.35657262802124s None\n",
      " idx:1030, loss:328.1631164550781, time spent:67.49287605285645s None\n",
      " idx:1040, loss:1149.6748046875, time spent:68.29556894302368s None\n",
      " idx:1050, loss:283.0771484375, time spent:68.88067865371704s None\n",
      " idx:1060, loss:139.73434448242188, time spent:68.96794652938843s None\n",
      " idx:1070, loss:274.1529235839844, time spent:69.16778707504272s None\n",
      " idx:1080, loss:158.44461059570312, time spent:69.27997636795044s None\n",
      " idx:1090, loss:752.9202880859375, time spent:70.41542911529541s None\n",
      " idx:1100, loss:365.3094177246094, time spent:70.57002425193787s None\n",
      " idx:1110, loss:925.414794921875, time spent:71.09765458106995s None\n",
      " idx:1120, loss:1500.529296875, time spent:73.94849920272827s None\n",
      " idx:1130, loss:336.6586608886719, time spent:74.16196274757385s None\n",
      " idx:1140, loss:1351.5477294921875, time spent:75.37397170066833s None\n",
      " idx:1150, loss:740.4388427734375, time spent:76.45296263694763s None\n",
      " idx:1160, loss:1432.5689697265625, time spent:77.71112275123596s None\n",
      " idx:1170, loss:555.1461181640625, time spent:77.93659353256226s None\n",
      " idx:1180, loss:195.37539672851562, time spent:78.26555705070496s None\n",
      " idx:1190, loss:633.9443359375, time spent:78.51508569717407s None\n",
      " idx:1200, loss:161.35000610351562, time spent:78.56899738311768s None\n",
      " idx:1210, loss:617.160400390625, time spent:78.88228940963745s None\n",
      " idx:1220, loss:927.2099609375, time spent:80.37907576560974s None\n",
      " idx:1230, loss:1488.241455078125, time spent:81.62489676475525s None\n",
      " idx:1240, loss:282.24853515625, time spent:82.26349210739136s None\n",
      " idx:1250, loss:158.70816040039062, time spent:82.40072178840637s None\n",
      " idx:1260, loss:358.0733337402344, time spent:83.2153742313385s None\n",
      " idx:1270, loss:380.92730712890625, time spent:83.5947482585907s None\n",
      " idx:1280, loss:1349.504150390625, time spent:84.69411396980286s None\n",
      " idx:1290, loss:430.58935546875, time spent:84.82868981361389s None\n",
      " idx:1300, loss:663.7659912109375, time spent:85.39682579040527s None\n",
      " idx:1310, loss:1052.513671875, time spent:86.11022663116455s None\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " idx:1320, loss:682.7471923828125, time spent:86.7038402557373s None\n",
      " idx:1330, loss:756.4534301757812, time spent:87.1572585105896s None\n",
      " idx:1340, loss:645.091796875, time spent:87.69128370285034s None\n",
      " idx:1350, loss:270.00372314453125, time spent:87.88241004943848s None\n",
      " idx:1360, loss:467.2586364746094, time spent:88.5405912399292s None\n",
      " idx:1370, loss:428.13299560546875, time spent:88.99136281013489s None\n",
      " idx:1380, loss:315.8162841796875, time spent:89.19093585014343s None\n",
      " idx:1390, loss:462.8202209472656, time spent:89.37779259681702s None\n",
      " idx:1400, loss:514.3253173828125, time spent:89.70245242118835s None\n",
      " idx:1410, loss:257.3545227050781, time spent:91.86869597434998s None\n",
      " idx:1420, loss:230.70523071289062, time spent:92.12386298179626s None\n",
      " idx:1430, loss:489.19171142578125, time spent:92.3139054775238s None\n",
      " idx:1440, loss:597.9323120117188, time spent:93.69416546821594s None\n",
      " idx:1450, loss:194.90664672851562, time spent:93.80499029159546s None\n",
      " idx:1460, loss:417.4690246582031, time spent:93.99172139167786s None\n",
      " idx:1470, loss:822.1744384765625, time spent:94.62607479095459s None\n",
      " idx:1480, loss:477.9854431152344, time spent:95.34678912162781s None\n",
      " idx:1490, loss:539.880859375, time spent:95.63093137741089s None\n",
      " idx:1500, loss:449.3720703125, time spent:95.85310578346252s None\n",
      " idx:1510, loss:524.0000610351562, time spent:96.9111578464508s None\n",
      " idx:1520, loss:388.22930908203125, time spent:97.20265340805054s None\n",
      " idx:1530, loss:1414.75732421875, time spent:98.02213287353516s None\n",
      " idx:1540, loss:463.3103942871094, time spent:98.35690569877625s None\n",
      " idx:1550, loss:332.2055969238281, time spent:98.52919316291809s None\n",
      " idx:1560, loss:328.7554931640625, time spent:99.37667465209961s None\n",
      " idx:1570, loss:753.5834350585938, time spent:99.98141121864319s None\n",
      " idx:1580, loss:117.32722473144531, time spent:100.03889751434326s None\n",
      " idx:1590, loss:401.927001953125, time spent:100.22352147102356s None\n",
      " idx:1600, loss:458.9984130859375, time spent:100.48687720298767s None\n",
      " idx:1610, loss:1093.1865234375, time spent:101.33369493484497s None\n",
      " idx:1620, loss:607.44140625, time spent:101.63742017745972s None\n",
      " idx:1630, loss:118.85650634765625, time spent:101.71049451828003s None\n",
      " idx:1640, loss:987.1119384765625, time spent:102.49069929122925s None\n",
      " idx:1650, loss:427.01580810546875, time spent:102.83458375930786s None\n",
      " idx:1660, loss:974.306396484375, time spent:103.92624425888062s None\n",
      " idx:1670, loss:729.7142944335938, time spent:104.61250424385071s None\n",
      " idx:1680, loss:757.057373046875, time spent:105.25997114181519s None\n",
      " idx:1690, loss:675.837646484375, time spent:105.85181736946106s None\n",
      " idx:1700, loss:398.2076416015625, time spent:107.25129866600037s None\n",
      " idx:1710, loss:854.3316040039062, time spent:108.11492037773132s None\n",
      " idx:1720, loss:129.37232971191406, time spent:108.1932065486908s None\n",
      " idx:1730, loss:923.9244995117188, time spent:108.98818349838257s None\n",
      " idx:1740, loss:816.328857421875, time spent:109.81828379631042s None\n",
      " idx:1750, loss:402.810546875, time spent:110.01347541809082s None\n",
      " idx:1760, loss:753.6591796875, time spent:110.28989005088806s None\n",
      " idx:1770, loss:942.7259521484375, time spent:111.2952561378479s None\n",
      " idx:1780, loss:428.12982177734375, time spent:111.74132227897644s None\n",
      " idx:1790, loss:260.2122497558594, time spent:111.8654534816742s None\n",
      " idx:1800, loss:423.83782958984375, time spent:112.15316367149353s None\n",
      " idx:1810, loss:449.90863037109375, time spent:112.51231098175049s None\n",
      " idx:1820, loss:334.8264465332031, time spent:113.12244653701782s None\n",
      " idx:1830, loss:754.0845947265625, time spent:114.04755449295044s None\n",
      " idx:1840, loss:1183.6666259765625, time spent:114.88647985458374s None\n",
      " idx:1850, loss:203.5263214111328, time spent:115.05510687828064s None\n",
      " idx:1860, loss:493.8402404785156, time spent:115.51292204856873s None\n",
      " idx:1870, loss:402.3121337890625, time spent:115.69949984550476s None\n",
      " idx:1880, loss:718.90234375, time spent:116.50960397720337s None\n",
      " idx:1890, loss:388.3748779296875, time spent:116.8123607635498s None\n",
      " idx:1900, loss:124.34642028808594, time spent:116.88352870941162s None\n",
      " idx:1910, loss:311.07208251953125, time spent:117.22539281845093s None\n",
      " idx:1920, loss:285.5340881347656, time spent:117.38370108604431s None\n",
      " idx:1930, loss:449.6513977050781, time spent:117.69342613220215s None\n",
      " idx:1940, loss:1197.2412109375, time spent:119.83903312683105s None\n",
      " idx:1950, loss:924.4342651367188, time spent:120.84209489822388s None\n",
      " idx:1960, loss:751.2924194335938, time spent:121.50445127487183s None\n",
      " idx:1970, loss:174.74237060546875, time spent:121.57269716262817s None\n",
      " idx:1980, loss:395.7021789550781, time spent:121.82154607772827s None\n",
      " idx:1990, loss:1017.2545776367188, time spent:122.64906978607178s None\n",
      " idx:2000, loss:390.2657470703125, time spent:123.02894306182861s None\n",
      " idx:2010, loss:178.4103546142578, time spent:123.69821977615356s None\n",
      " idx:2020, loss:339.1018371582031, time spent:123.92264103889465s None\n",
      " idx:2030, loss:156.274169921875, time spent:124.00187563896179s None\n",
      " idx:2040, loss:245.2938690185547, time spent:124.05746841430664s None\n",
      " idx:2050, loss:425.1319580078125, time spent:124.54227256774902s None\n",
      " idx:2060, loss:593.336181640625, time spent:124.78424286842346s None\n",
      " idx:2070, loss:554.6564331054688, time spent:125.19223356246948s None\n",
      " idx:2080, loss:1025.4722900390625, time spent:126.35137438774109s None\n",
      " idx:2090, loss:480.0524597167969, time spent:126.7506275177002s None\n",
      " idx:2100, loss:123.75334930419922, time spent:126.83739495277405s None\n",
      " idx:2110, loss:442.6434631347656, time spent:127.0189471244812s None\n",
      " idx:2120, loss:392.4903259277344, time spent:127.35150074958801s None\n",
      " idx:2130, loss:731.9781494140625, time spent:128.4291274547577s None\n",
      " idx:2140, loss:523.817138671875, time spent:128.72364592552185s None\n",
      " idx:2150, loss:398.23028564453125, time spent:129.30100274085999s None\n",
      " idx:2160, loss:268.5067138671875, time spent:129.53289675712585s None\n",
      " idx:2170, loss:721.580322265625, time spent:129.8569459915161s None\n",
      " idx:2180, loss:277.31475830078125, time spent:130.16317105293274s None\n",
      " idx:2190, loss:293.133544921875, time spent:130.36096096038818s None\n",
      " idx:2200, loss:649.5787353515625, time spent:130.70578122138977s None\n",
      " idx:2210, loss:1052.754638671875, time spent:131.53320002555847s None\n",
      " idx:2220, loss:864.4613037109375, time spent:132.3121018409729s None\n",
      " idx:2230, loss:705.568359375, time spent:133.14868903160095s None\n",
      " idx:2240, loss:236.18328857421875, time spent:133.30977177619934s None\n",
      " idx:2250, loss:468.85272216796875, time spent:133.5807385444641s None\n",
      " idx:2260, loss:292.5279235839844, time spent:133.69980764389038s None\n",
      " idx:2270, loss:900.67236328125, time spent:134.77383136749268s None\n",
      " idx:2280, loss:876.8763427734375, time spent:135.50645327568054s None\n",
      " idx:2290, loss:799.623291015625, time spent:136.24407076835632s None\n",
      " idx:2300, loss:251.80223083496094, time spent:136.3772838115692s None\n",
      " idx:2310, loss:1576.43115234375, time spent:137.4020552635193s None\n",
      " idx:2320, loss:672.1563720703125, time spent:138.1704490184784s None\n",
      " idx:2330, loss:1908.8056640625, time spent:138.9559144973755s None\n",
      " idx:2340, loss:351.2317810058594, time spent:139.13313555717468s None\n",
      " idx:2350, loss:326.5136413574219, time spent:139.44811129570007s None\n",
      " idx:2360, loss:919.6851806640625, time spent:139.9254813194275s None\n",
      " idx:2370, loss:458.3380126953125, time spent:140.4660005569458s None\n",
      " idx:2380, loss:252.73812866210938, time spent:140.5624134540558s None\n",
      " idx:2390, loss:752.1027221679688, time spent:141.06406378746033s None\n",
      " idx:2400, loss:410.0663757324219, time spent:141.32239079475403s None\n",
      " idx:2410, loss:479.9764404296875, time spent:141.74098443984985s None\n",
      " idx:2420, loss:676.0509033203125, time spent:142.23582434654236s None\n",
      " idx:2430, loss:543.9620361328125, time spent:142.47962260246277s None\n",
      " idx:2440, loss:316.82916259765625, time spent:142.71913933753967s None\n",
      " idx:2450, loss:398.3730773925781, time spent:142.9002664089203s None\n",
      " idx:2460, loss:568.3074340820312, time spent:143.28572273254395s None\n",
      " idx:2470, loss:945.4580078125, time spent:143.87437844276428s None\n",
      " idx:2480, loss:460.5022888183594, time spent:144.12061524391174s None\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " idx:2490, loss:443.92608642578125, time spent:144.3009147644043s None\n",
      " idx:2500, loss:330.4812927246094, time spent:144.59301614761353s None\n",
      " idx:2510, loss:460.8628845214844, time spent:145.30543565750122s None\n",
      " idx:2520, loss:735.3001098632812, time spent:146.29078769683838s None\n",
      " idx:2530, loss:665.72802734375, time spent:147.3133909702301s None\n",
      " idx:2540, loss:810.57470703125, time spent:148.00355982780457s None\n",
      " idx:2550, loss:394.7431640625, time spent:148.17621660232544s None\n",
      " idx:2560, loss:945.1940307617188, time spent:149.09766459465027s None\n",
      " idx:2570, loss:239.21142578125, time spent:149.3643229007721s None\n",
      " idx:2580, loss:232.85250854492188, time spent:149.5208888053894s None\n",
      " idx:2590, loss:470.0151672363281, time spent:150.09727478027344s None\n",
      " idx:2600, loss:607.6190795898438, time spent:150.70494842529297s None\n",
      " idx:2610, loss:703.98291015625, time spent:151.50459384918213s None\n",
      " idx:2620, loss:1309.82568359375, time spent:152.33807277679443s None\n",
      " idx:2630, loss:844.0194091796875, time spent:152.81623077392578s None\n",
      " idx:2640, loss:184.1024932861328, time spent:152.91810035705566s None\n",
      " idx:2650, loss:288.19970703125, time spent:153.04028367996216s None\n",
      " idx:2660, loss:1375.62841796875, time spent:153.81331157684326s None\n",
      " idx:2670, loss:922.1788330078125, time spent:154.41765689849854s None\n",
      " idx:2680, loss:114.68685150146484, time spent:154.4597556591034s None\n",
      " idx:2690, loss:474.8375244140625, time spent:154.79374194145203s None\n",
      " idx:2700, loss:843.365234375, time spent:155.48040556907654s None\n",
      " idx:2710, loss:1272.2642822265625, time spent:156.8094277381897s None\n",
      " idx:2720, loss:541.7230834960938, time spent:157.22440576553345s None\n",
      " idx:2730, loss:376.2390441894531, time spent:158.3337059020996s None\n",
      " idx:2740, loss:681.1436767578125, time spent:159.0068244934082s None\n",
      " idx:2750, loss:817.93017578125, time spent:159.8542697429657s None\n",
      " idx:2760, loss:779.5086669921875, time spent:161.04829216003418s None\n",
      " idx:2770, loss:393.5565185546875, time spent:161.5625500679016s None\n",
      " idx:2780, loss:381.37139892578125, time spent:162.1454746723175s None\n",
      " idx:2790, loss:748.6993408203125, time spent:162.8262279033661s None\n",
      " idx:2800, loss:89.20972442626953, time spent:162.9409523010254s None\n",
      " idx:2810, loss:296.45361328125, time spent:164.03925561904907s None\n",
      " idx:2820, loss:289.40557861328125, time spent:164.23963904380798s None\n",
      " idx:2830, loss:1086.745361328125, time spent:164.960191488266s None\n",
      " idx:2840, loss:481.8846435546875, time spent:165.4237129688263s None\n",
      " idx:2850, loss:323.5229797363281, time spent:165.68373250961304s None\n",
      " idx:2860, loss:711.5235595703125, time spent:166.2301788330078s None\n",
      " idx:2870, loss:395.12841796875, time spent:166.40826106071472s None\n",
      " idx:2880, loss:960.9376220703125, time spent:167.3820869922638s None\n",
      " idx:2890, loss:491.6974792480469, time spent:167.8857135772705s None\n",
      " idx:2900, loss:306.10009765625, time spent:168.83117055892944s None\n",
      " idx:2910, loss:228.33865356445312, time spent:169.44708156585693s None\n",
      " idx:2920, loss:570.348876953125, time spent:170.02720284461975s None\n",
      " idx:2930, loss:253.7493438720703, time spent:170.11554670333862s None\n",
      " idx:2940, loss:659.5266723632812, time spent:170.76163601875305s None\n",
      " idx:2950, loss:339.28173828125, time spent:170.945054769516s None\n",
      " idx:2960, loss:413.66668701171875, time spent:171.62058281898499s None\n",
      " idx:2970, loss:240.2041473388672, time spent:171.70104956626892s None\n",
      " idx:2980, loss:162.460205078125, time spent:171.78349113464355s None\n",
      " idx:2990, loss:262.9910888671875, time spent:171.9087131023407s None\n",
      " idx:3000, loss:963.1246948242188, time spent:173.11021542549133s None\n",
      " idx:3010, loss:856.9695434570312, time spent:173.79125118255615s None\n",
      " idx:3020, loss:420.9539794921875, time spent:173.95308709144592s None\n",
      " idx:3030, loss:320.667724609375, time spent:174.9143922328949s None\n",
      " idx:3040, loss:760.1922607421875, time spent:175.77123188972473s None\n",
      " idx:3050, loss:251.63168334960938, time spent:176.53473377227783s None\n",
      " idx:3060, loss:346.638671875, time spent:176.83973217010498s None\n",
      " idx:3070, loss:482.47100830078125, time spent:177.13238191604614s None\n",
      " idx:3080, loss:861.8043212890625, time spent:177.84363889694214s None\n",
      " idx:3090, loss:798.7181396484375, time spent:178.7536656856537s None\n",
      " idx:3100, loss:451.20233154296875, time spent:178.99035596847534s None\n",
      " idx:3110, loss:735.011474609375, time spent:179.8891339302063s None\n",
      " idx:3120, loss:174.49180603027344, time spent:179.9795117378235s None\n",
      " idx:3130, loss:680.4495239257812, time spent:180.6492097377777s None\n",
      " idx:3140, loss:330.15850830078125, time spent:180.98342871665955s None\n",
      " idx:3150, loss:185.06658935546875, time spent:181.10062336921692s None\n",
      " idx:3160, loss:1020.1253662109375, time spent:182.12644171714783s None\n",
      " idx:3170, loss:884.8878173828125, time spent:183.99112153053284s None\n",
      " idx:3180, loss:257.1004943847656, time spent:184.2234230041504s None\n",
      " idx:3190, loss:451.5397644042969, time spent:184.70344161987305s None\n",
      " idx:3200, loss:253.5560760498047, time spent:184.80490851402283s None\n",
      " idx:3210, loss:1120.70703125, time spent:185.83590078353882s None\n",
      " idx:3220, loss:228.9390411376953, time spent:186.00318503379822s None\n",
      " idx:3230, loss:975.753662109375, time spent:186.8137013912201s None\n",
      " idx:3240, loss:113.38047790527344, time spent:186.8895707130432s None\n",
      " idx:3250, loss:860.71435546875, time spent:187.8318223953247s None\n",
      " idx:3260, loss:826.5802612304688, time spent:188.7661464214325s None\n",
      " idx:3270, loss:329.234375, time spent:189.00124406814575s None\n",
      " idx:3280, loss:1368.2518310546875, time spent:189.95523285865784s None\n",
      " idx:3290, loss:142.4335479736328, time spent:189.99581456184387s None\n",
      " idx:3300, loss:1213.2381591796875, time spent:190.97004866600037s None\n",
      " idx:3310, loss:182.42027282714844, time spent:191.12517094612122s None\n",
      " idx:3320, loss:760.9201049804688, time spent:191.57686018943787s None\n",
      " idx:3330, loss:794.1502685546875, time spent:191.97123503684998s None\n",
      " idx:3340, loss:395.3437194824219, time spent:192.13930010795593s None\n",
      " idx:3350, loss:1184.8564453125, time spent:192.94427943229675s None\n",
      " idx:3360, loss:402.9505615234375, time spent:193.42071628570557s None\n",
      " idx:3370, loss:700.073486328125, time spent:194.2028887271881s None\n",
      " idx:3373, loss:969.599609375, time spent:195.4563012123108s None\n",
      "(101508,)\n",
      "(101508,)\n",
      "(101508,)\n",
      "\n",
      " auc=0.8253371969742336, accuracy=0.7722051463924026, precision=[ 0.70633421  0.79240523], recall=[ 0.51062087  0.89794906]\n",
      " idx:10, loss:316.9486083984375, time spent:0.3292074203491211s None\n",
      " idx:20, loss:581.1411743164062, time spent:0.7417819499969482s None\n",
      " idx:30, loss:1023.819580078125, time spent:1.6183676719665527s None\n",
      " idx:40, loss:377.7077941894531, time spent:2.645907163619995s None\n",
      " idx:50, loss:515.80908203125, time spent:2.818011999130249s None\n",
      " idx:60, loss:230.12277221679688, time spent:2.902534246444702s None\n",
      " idx:70, loss:303.5433654785156, time spent:3.676980495452881s None\n",
      " idx:80, loss:924.02392578125, time spent:4.54840612411499s None\n",
      " idx:90, loss:561.4065551757812, time spent:5.119595050811768s None\n",
      " idx:100, loss:313.0903625488281, time spent:5.386940240859985s None\n",
      " idx:110, loss:679.0108032226562, time spent:6.636380434036255s None\n",
      " idx:120, loss:217.55987548828125, time spent:6.772002220153809s None\n",
      " idx:130, loss:1479.1510009765625, time spent:7.789529800415039s None\n",
      " idx:140, loss:117.13414764404297, time spent:7.88515043258667s None\n",
      " idx:150, loss:447.60833740234375, time spent:9.152456521987915s None\n",
      " idx:160, loss:464.588134765625, time spent:9.571222066879272s None\n",
      " idx:170, loss:288.8377685546875, time spent:9.783881664276123s None\n",
      " idx:180, loss:1224.927001953125, time spent:10.747587442398071s None\n",
      " idx:190, loss:1310.309814453125, time spent:11.68967890739441s None\n",
      " idx:200, loss:1279.5958251953125, time spent:14.25468111038208s None\n",
      " idx:210, loss:218.17149353027344, time spent:14.500481128692627s None\n",
      " idx:220, loss:240.83657836914062, time spent:14.619088172912598s None\n",
      " idx:230, loss:562.180419921875, time spent:14.969179153442383s None\n",
      " idx:240, loss:465.60943603515625, time spent:15.623932123184204s None\n",
      " idx:250, loss:345.7132263183594, time spent:15.900883913040161s None\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " idx:260, loss:366.4255065917969, time spent:16.249080419540405s None\n",
      " idx:270, loss:412.31842041015625, time spent:17.073867559432983s None\n",
      " idx:280, loss:734.9402465820312, time spent:17.436878204345703s None\n",
      " idx:290, loss:565.094970703125, time spent:18.027386903762817s None\n",
      " idx:300, loss:339.8606872558594, time spent:18.217916011810303s None\n",
      " idx:310, loss:481.4337463378906, time spent:18.904322385787964s None\n",
      " idx:320, loss:1556.5628662109375, time spent:19.836849212646484s None\n",
      " idx:330, loss:925.9843139648438, time spent:20.55491352081299s None\n",
      " idx:340, loss:1117.0235595703125, time spent:21.690000772476196s None\n",
      " idx:350, loss:208.7222900390625, time spent:21.815455675125122s None\n",
      " idx:360, loss:409.28619384765625, time spent:22.05802631378174s None\n",
      " idx:370, loss:266.66619873046875, time spent:23.092935800552368s None\n",
      " idx:380, loss:204.6671142578125, time spent:23.25142502784729s None\n",
      " idx:390, loss:1064.8917236328125, time spent:24.139179468154907s None\n",
      " idx:400, loss:183.2242431640625, time spent:24.25105357170105s None\n",
      " idx:410, loss:177.39776611328125, time spent:24.341719150543213s None\n",
      " idx:420, loss:307.6764831542969, time spent:24.539867401123047s None\n",
      " idx:430, loss:218.25946044921875, time spent:24.690731048583984s None\n",
      " idx:440, loss:1251.134033203125, time spent:25.96845507621765s None\n",
      " idx:450, loss:344.0234069824219, time spent:26.69842219352722s None\n",
      " idx:460, loss:240.64895629882812, time spent:28.03383493423462s None\n",
      " idx:470, loss:63.07569885253906, time spent:28.06053638458252s None\n",
      " idx:480, loss:447.86077880859375, time spent:28.71483874320984s None\n",
      " idx:490, loss:298.7171936035156, time spent:29.10486364364624s None\n",
      " idx:500, loss:929.088134765625, time spent:29.829813480377197s None\n",
      " idx:510, loss:323.1772155761719, time spent:30.224533319473267s None\n",
      " idx:520, loss:1288.365478515625, time spent:30.990196228027344s None\n",
      " idx:530, loss:229.52166748046875, time spent:31.799877643585205s None\n",
      " idx:540, loss:524.5773315429688, time spent:32.0730357170105s None\n",
      " idx:550, loss:1069.0443115234375, time spent:33.43670606613159s None\n",
      " idx:560, loss:762.3678588867188, time spent:34.04503583908081s None\n",
      " idx:570, loss:642.751220703125, time spent:34.75042963027954s None\n",
      " idx:580, loss:591.6126098632812, time spent:35.32987713813782s None\n",
      " idx:590, loss:530.8924560546875, time spent:35.70901703834534s None\n",
      " idx:600, loss:1271.0068359375, time spent:36.59710240364075s None\n",
      " idx:610, loss:678.3211669921875, time spent:37.82623815536499s None\n",
      " idx:620, loss:500.64794921875, time spent:38.53877520561218s None\n",
      " idx:630, loss:395.2607421875, time spent:38.77905631065369s None\n",
      " idx:640, loss:376.6183776855469, time spent:39.14393973350525s None\n",
      " idx:650, loss:478.2318420410156, time spent:39.59451246261597s None\n",
      " idx:660, loss:189.30006408691406, time spent:39.74186825752258s None\n",
      " idx:670, loss:141.97036743164062, time spent:39.81760811805725s None\n",
      " idx:680, loss:360.9716491699219, time spent:40.05947971343994s None\n",
      " idx:690, loss:164.50543212890625, time spent:40.127034425735474s None\n",
      " idx:700, loss:1003.847412109375, time spent:40.86508131027222s None\n",
      " idx:710, loss:512.802978515625, time spent:41.32656717300415s None\n",
      " idx:720, loss:563.014404296875, time spent:41.982356548309326s None\n",
      " idx:730, loss:285.464111328125, time spent:42.35357356071472s None\n",
      " idx:740, loss:207.23826599121094, time spent:42.59656262397766s None\n",
      " idx:750, loss:197.86062622070312, time spent:42.756492376327515s None\n",
      " idx:760, loss:945.7769775390625, time spent:43.668925285339355s None\n",
      " idx:770, loss:105.03064727783203, time spent:43.700854778289795s None\n",
      " idx:780, loss:738.5858764648438, time spent:44.13945770263672s None\n",
      " idx:790, loss:616.760498046875, time spent:45.170480728149414s None\n",
      " idx:800, loss:223.88674926757812, time spent:45.318753480911255s None\n",
      " idx:810, loss:891.183837890625, time spent:45.9653742313385s None\n",
      " idx:820, loss:1181.13330078125, time spent:50.917789936065674s None\n",
      " idx:830, loss:590.8095092773438, time spent:51.61250138282776s None\n",
      " idx:840, loss:686.8372192382812, time spent:52.19457244873047s None\n",
      " idx:850, loss:663.0827026367188, time spent:53.02224564552307s None\n",
      " idx:860, loss:502.7254638671875, time spent:53.845890283584595s None\n",
      " idx:870, loss:438.7309875488281, time spent:54.05755543708801s None\n",
      " idx:880, loss:154.0261688232422, time spent:54.15374803543091s None\n",
      " idx:890, loss:1324.7293701171875, time spent:54.8673632144928s None\n",
      " idx:900, loss:229.32290649414062, time spent:55.426841497421265s None\n",
      " idx:910, loss:571.8433837890625, time spent:57.053056955337524s None\n",
      " idx:920, loss:476.1620788574219, time spent:57.42225432395935s None\n",
      " idx:930, loss:211.67662048339844, time spent:57.534058809280396s None\n",
      " idx:940, loss:208.51400756835938, time spent:57.77085828781128s None\n",
      " idx:950, loss:603.600341796875, time spent:58.22753310203552s None\n",
      " idx:960, loss:669.8630981445312, time spent:58.50644540786743s None\n",
      " idx:970, loss:714.2711791992188, time spent:59.186402559280396s None\n",
      " idx:980, loss:492.14105224609375, time spent:59.540648221969604s None\n",
      " idx:990, loss:208.40847778320312, time spent:59.59007501602173s None\n",
      " idx:1000, loss:991.978271484375, time spent:60.218867778778076s None\n",
      " idx:1010, loss:217.97071838378906, time spent:60.370646238327026s None\n",
      " idx:1020, loss:721.0856323242188, time spent:61.20579171180725s None\n",
      " idx:1030, loss:1308.294921875, time spent:62.09192156791687s None\n",
      " idx:1040, loss:358.0061950683594, time spent:62.82192373275757s None\n",
      " idx:1050, loss:480.43572998046875, time spent:63.09404277801514s None\n",
      " idx:1060, loss:722.9131469726562, time spent:64.50111722946167s None\n",
      " idx:1070, loss:406.3833923339844, time spent:64.78624677658081s None\n",
      " idx:1080, loss:287.4520263671875, time spent:64.93278455734253s None\n",
      " idx:1090, loss:220.4781951904297, time spent:65.05553531646729s None\n",
      " idx:1100, loss:1045.1551513671875, time spent:65.75273060798645s None\n",
      " idx:1110, loss:517.609375, time spent:66.58316421508789s None\n",
      " idx:1120, loss:388.83056640625, time spent:66.76977944374084s None\n",
      " idx:1130, loss:695.29443359375, time spent:67.65065860748291s None\n",
      " idx:1140, loss:209.87168884277344, time spent:68.20253467559814s None\n",
      " idx:1150, loss:147.90853881835938, time spent:68.3142876625061s None\n",
      " idx:1160, loss:197.06491088867188, time spent:68.47036361694336s None\n",
      " idx:1170, loss:290.489013671875, time spent:68.96067810058594s None\n",
      " idx:1180, loss:914.1116943359375, time spent:70.53281235694885s None\n",
      " idx:1190, loss:818.698974609375, time spent:71.26076412200928s None\n",
      " idx:1200, loss:1106.6351318359375, time spent:72.07557845115662s None\n",
      " idx:1210, loss:751.0516357421875, time spent:72.82473111152649s None\n",
      " idx:1220, loss:187.0076141357422, time spent:72.92866587638855s None\n",
      " idx:1230, loss:249.5998992919922, time spent:73.1601197719574s None\n",
      " idx:1240, loss:194.08657836914062, time spent:73.29801917076111s None\n",
      " idx:1250, loss:422.6466979980469, time spent:73.6275086402893s None\n",
      " idx:1260, loss:221.89208984375, time spent:73.76349472999573s None\n",
      " idx:1270, loss:168.3562469482422, time spent:73.95893836021423s None\n",
      " idx:1280, loss:1429.817626953125, time spent:74.68373107910156s None\n",
      " idx:1290, loss:39.102508544921875, time spent:74.72306180000305s None\n",
      " idx:1300, loss:478.4979553222656, time spent:75.3821382522583s None\n",
      " idx:1310, loss:714.118408203125, time spent:76.11014151573181s None\n",
      " idx:1320, loss:481.83135986328125, time spent:76.60105872154236s None\n",
      " idx:1330, loss:788.1697387695312, time spent:77.34733986854553s None\n",
      " idx:1340, loss:338.54107666015625, time spent:77.84239196777344s None\n",
      " idx:1350, loss:593.7974243164062, time spent:78.26947450637817s None\n",
      " idx:1360, loss:346.1403503417969, time spent:78.51963543891907s None\n",
      " idx:1370, loss:1242.864501953125, time spent:79.23211288452148s None\n",
      " idx:1380, loss:222.82586669921875, time spent:79.47868943214417s None\n",
      " idx:1390, loss:347.1649169921875, time spent:79.69967603683472s None\n",
      " idx:1400, loss:1834.604248046875, time spent:80.65111637115479s None\n",
      " idx:1410, loss:1379.768798828125, time spent:81.40566682815552s None\n",
      " idx:1420, loss:1122.5577392578125, time spent:82.0986475944519s None\n",
      " idx:1430, loss:1400.659912109375, time spent:83.3804578781128s None\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " idx:1440, loss:302.18646240234375, time spent:83.60148334503174s None\n",
      " idx:1450, loss:1034.006103515625, time spent:84.6109688282013s None\n",
      " idx:1460, loss:150.79823303222656, time spent:84.74998068809509s None\n",
      " idx:1470, loss:1010.8372802734375, time spent:85.78819274902344s None\n",
      " idx:1480, loss:516.1414794921875, time spent:86.06290102005005s None\n",
      " idx:1490, loss:62.226829528808594, time spent:86.1006350517273s None\n",
      " idx:1500, loss:1206.0478515625, time spent:87.31481122970581s None\n",
      " idx:1510, loss:479.6680908203125, time spent:88.4419014453888s None\n",
      " idx:1520, loss:256.11981201171875, time spent:88.66863465309143s None\n",
      " idx:1530, loss:1081.1768798828125, time spent:89.35572266578674s None\n",
      " idx:1540, loss:298.6546630859375, time spent:90.57133865356445s None\n",
      " idx:1550, loss:398.951171875, time spent:90.85570478439331s None\n",
      " idx:1560, loss:312.5352783203125, time spent:91.08828115463257s None\n",
      " idx:1570, loss:393.9125061035156, time spent:91.22119235992432s None\n",
      " idx:1580, loss:348.80670166015625, time spent:92.31714630126953s None\n",
      " idx:1590, loss:238.0402069091797, time spent:92.80353593826294s None\n",
      " idx:1600, loss:150.24221801757812, time spent:94.03222918510437s None\n",
      " idx:1610, loss:297.8377380371094, time spent:94.26611542701721s None\n",
      " idx:1620, loss:817.4436645507812, time spent:95.2391586303711s None\n",
      " idx:1630, loss:164.49755859375, time spent:95.31913876533508s None\n",
      " idx:1640, loss:407.47174072265625, time spent:95.60894346237183s None\n",
      " idx:1650, loss:516.47998046875, time spent:95.86939692497253s None\n",
      " idx:1660, loss:438.70159912109375, time spent:96.50808715820312s None\n",
      " idx:1670, loss:782.5672607421875, time spent:97.43846893310547s None\n",
      " idx:1680, loss:656.7042236328125, time spent:97.88272476196289s None\n",
      " idx:1690, loss:151.42929077148438, time spent:97.96829056739807s None\n",
      " idx:1700, loss:998.4956665039062, time spent:98.54381895065308s None\n",
      " idx:1710, loss:188.46469116210938, time spent:98.59018015861511s None\n",
      " idx:1720, loss:234.0698699951172, time spent:98.70458745956421s None\n",
      " idx:1730, loss:134.25372314453125, time spent:98.82956886291504s None\n",
      " idx:1740, loss:900.6256713867188, time spent:99.83426547050476s None\n",
      " idx:1750, loss:659.8189086914062, time spent:100.50674343109131s None\n",
      " idx:1760, loss:235.94703674316406, time spent:100.67343306541443s None\n",
      " idx:1770, loss:531.182861328125, time spent:101.5753378868103s None\n",
      " idx:1780, loss:739.4267578125, time spent:102.55886578559875s None\n",
      " idx:1790, loss:851.375732421875, time spent:103.64624524116516s None\n",
      " idx:1800, loss:307.58038330078125, time spent:103.85148596763611s None\n",
      " idx:1810, loss:1636.3824462890625, time spent:104.76685738563538s None\n",
      " idx:1820, loss:817.4117431640625, time spent:105.46912860870361s None\n",
      " idx:1830, loss:428.1230773925781, time spent:105.8263623714447s None\n",
      " idx:1840, loss:202.54971313476562, time spent:105.97503161430359s None\n",
      " idx:1850, loss:311.73956298828125, time spent:106.29152965545654s None\n",
      " idx:1860, loss:879.8756103515625, time spent:106.97631049156189s None\n",
      " idx:1870, loss:688.9625244140625, time spent:107.70199704170227s None\n",
      " idx:1880, loss:353.9840393066406, time spent:107.97847366333008s None\n",
      " idx:1890, loss:1300.2135009765625, time spent:109.35765409469604s None\n",
      " idx:1900, loss:585.5365600585938, time spent:111.12146544456482s None\n",
      " idx:1910, loss:1060.319091796875, time spent:111.90278244018555s None\n",
      " idx:1920, loss:931.9501953125, time spent:112.60079979896545s None\n",
      " idx:1930, loss:464.015625, time spent:112.90232491493225s None\n",
      " idx:1940, loss:738.016357421875, time spent:113.71983790397644s None\n",
      " idx:1950, loss:342.7580261230469, time spent:114.35004734992981s None\n",
      " idx:1960, loss:611.4669189453125, time spent:114.6190414428711s None\n",
      " idx:1970, loss:232.54827880859375, time spent:115.70549941062927s None\n",
      " idx:1980, loss:361.12493896484375, time spent:116.13418531417847s None\n",
      " idx:1990, loss:451.02581787109375, time spent:116.53448724746704s None\n",
      " idx:2000, loss:1541.1536865234375, time spent:117.33817911148071s None\n",
      " idx:2010, loss:405.35546875, time spent:117.76937174797058s None\n",
      " idx:2020, loss:387.62445068359375, time spent:118.08147430419922s None\n",
      " idx:2030, loss:396.30328369140625, time spent:118.26694703102112s None\n",
      " idx:2040, loss:244.04222106933594, time spent:118.44195127487183s None\n",
      " idx:2050, loss:229.87094116210938, time spent:118.60049343109131s None\n",
      " idx:2060, loss:684.3265991210938, time spent:119.3828957080841s None\n",
      " idx:2070, loss:503.3739013671875, time spent:119.862633228302s None\n",
      " idx:2080, loss:833.6034545898438, time spent:120.67498397827148s None\n",
      " idx:2090, loss:886.406005859375, time spent:120.99772000312805s None\n",
      " idx:2100, loss:106.12730407714844, time spent:121.04999613761902s None\n",
      " idx:2110, loss:229.12271118164062, time spent:121.61395120620728s None\n",
      " idx:2120, loss:393.8041687011719, time spent:121.89598107337952s None\n",
      " idx:2130, loss:568.0532836914062, time spent:122.94457745552063s None\n",
      " idx:2140, loss:308.7109069824219, time spent:123.5767593383789s None\n",
      " idx:2150, loss:866.4195556640625, time spent:124.30568385124207s None\n",
      " idx:2160, loss:727.5810546875, time spent:125.2674651145935s None\n",
      " idx:2170, loss:776.5218505859375, time spent:126.31818723678589s None\n",
      " idx:2180, loss:490.49554443359375, time spent:126.57483983039856s None\n",
      " idx:2190, loss:740.385498046875, time spent:127.38598561286926s None\n",
      " idx:2200, loss:894.3778686523438, time spent:128.23091387748718s None\n",
      " idx:2210, loss:494.4593811035156, time spent:128.4679114818573s None\n",
      " idx:2220, loss:539.48828125, time spent:129.29859614372253s None\n",
      " idx:2230, loss:378.68341064453125, time spent:129.59653496742249s None\n",
      " idx:2240, loss:747.8750610351562, time spent:130.37060976028442s None\n",
      " idx:2250, loss:669.1895751953125, time spent:130.9473683834076s None\n",
      " idx:2260, loss:741.1469116210938, time spent:131.927983045578s None\n",
      " idx:2270, loss:947.2381591796875, time spent:132.8178219795227s None\n",
      " idx:2280, loss:949.2911987304688, time spent:133.61572003364563s None\n",
      " idx:2290, loss:1331.1312255859375, time spent:136.18381667137146s None\n",
      " idx:2300, loss:311.9329528808594, time spent:136.3350167274475s None\n",
      " idx:2310, loss:300.96075439453125, time spent:137.70244598388672s None\n",
      " idx:2320, loss:1104.22314453125, time spent:138.3967022895813s None\n",
      " idx:2330, loss:213.2326202392578, time spent:138.57540154457092s None\n",
      " idx:2340, loss:323.4908142089844, time spent:138.8453516960144s None\n",
      " idx:2350, loss:1615.108154296875, time spent:139.7389259338379s None\n",
      " idx:2360, loss:766.8202514648438, time spent:140.3189206123352s None\n",
      " idx:2370, loss:344.77392578125, time spent:140.44972586631775s None\n",
      " idx:2380, loss:871.2156372070312, time spent:140.97488951683044s None\n",
      " idx:2390, loss:705.2425537109375, time spent:142.030779838562s None\n",
      " idx:2400, loss:374.6827392578125, time spent:142.3229763507843s None\n",
      " idx:2410, loss:748.6714477539062, time spent:142.70687651634216s None\n",
      " idx:2420, loss:88.98899841308594, time spent:143.22661328315735s None\n",
      " idx:2430, loss:454.5283508300781, time spent:143.55246090888977s None\n",
      " idx:2440, loss:401.24163818359375, time spent:143.84580540657043s None\n",
      " idx:2450, loss:635.1404418945312, time spent:144.39653253555298s None\n",
      " idx:2460, loss:1252.6280517578125, time spent:145.37829279899597s None\n",
      " idx:2470, loss:286.8777160644531, time spent:145.48371124267578s None\n",
      " idx:2480, loss:290.17413330078125, time spent:145.74003267288208s None\n",
      " idx:2490, loss:1066.5333251953125, time spent:146.65239882469177s None\n",
      " idx:2500, loss:635.366943359375, time spent:147.42976355552673s None\n",
      " idx:2510, loss:1606.25048828125, time spent:148.73365831375122s None\n",
      " idx:2520, loss:315.3301086425781, time spent:149.1767761707306s None\n",
      " idx:2530, loss:107.52261352539062, time spent:150.0571460723877s None\n",
      " idx:2540, loss:627.5657958984375, time spent:150.98326301574707s None\n",
      " idx:2550, loss:849.213623046875, time spent:151.5774064064026s None\n",
      " idx:2560, loss:497.9382019042969, time spent:151.8637146949768s None\n",
      " idx:2570, loss:183.57537841796875, time spent:152.6328785419464s None\n",
      " idx:2580, loss:750.0470581054688, time spent:153.11233186721802s None\n",
      " idx:2590, loss:956.9247436523438, time spent:154.28917789459229s None\n",
      " idx:2600, loss:440.0661926269531, time spent:154.51954340934753s None\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " idx:2610, loss:274.4029541015625, time spent:154.79099440574646s None\n",
      " idx:2620, loss:320.9650573730469, time spent:155.0629904270172s None\n",
      " idx:2630, loss:290.6509094238281, time spent:155.26835346221924s None\n",
      " idx:2640, loss:350.2647705078125, time spent:155.5593888759613s None\n",
      " idx:2650, loss:194.48257446289062, time spent:155.75509977340698s None\n",
      " idx:2660, loss:200.90286254882812, time spent:155.90821647644043s None\n",
      " idx:2670, loss:158.04579162597656, time spent:156.10122418403625s None\n",
      " idx:2680, loss:855.1045532226562, time spent:156.91870522499084s None\n",
      " idx:2690, loss:287.3997802734375, time spent:157.07012248039246s None\n",
      " idx:2700, loss:1028.1507568359375, time spent:157.98401474952698s None\n",
      " idx:2710, loss:1558.948486328125, time spent:158.94495701789856s None\n",
      " idx:2720, loss:1095.6976318359375, time spent:159.99234056472778s None\n",
      " idx:2730, loss:435.7896423339844, time spent:160.3836579322815s None\n",
      " idx:2740, loss:1475.985595703125, time spent:161.54235243797302s None\n",
      " idx:2750, loss:444.15771484375, time spent:161.97075414657593s None\n",
      " idx:2760, loss:344.4588928222656, time spent:162.36550164222717s None\n",
      " idx:2770, loss:430.9953918457031, time spent:163.1942229270935s None\n",
      " idx:2780, loss:314.1199645996094, time spent:163.3174512386322s None\n",
      " idx:2790, loss:354.2036437988281, time spent:163.49264430999756s None\n",
      " idx:2800, loss:747.0313110351562, time spent:164.23721027374268s None\n",
      " idx:2810, loss:327.11773681640625, time spent:164.49569988250732s None\n",
      " idx:2820, loss:651.0155029296875, time spent:164.94329380989075s None\n",
      " idx:2830, loss:1159.8165283203125, time spent:165.71393179893494s None\n",
      " idx:2840, loss:159.78729248046875, time spent:165.96678733825684s None\n",
      " idx:2850, loss:294.46368408203125, time spent:166.3060233592987s None\n",
      " idx:2860, loss:117.59326171875, time spent:166.49802803993225s None\n",
      " idx:2870, loss:820.47900390625, time spent:167.40245294570923s None\n",
      " idx:2880, loss:694.582275390625, time spent:168.10098528862s None\n",
      " idx:2890, loss:380.2662048339844, time spent:168.38455986976624s None\n",
      " idx:2900, loss:504.4737548828125, time spent:169.05063462257385s None\n",
      " idx:2910, loss:693.4242553710938, time spent:169.74374866485596s None\n",
      " idx:2920, loss:155.83326721191406, time spent:169.8530821800232s None\n",
      " idx:2930, loss:195.3975830078125, time spent:170.03803753852844s None\n",
      " idx:2940, loss:403.0403137207031, time spent:170.32859349250793s None\n",
      " idx:2950, loss:514.0946044921875, time spent:170.63404321670532s None\n",
      " idx:2960, loss:351.2686462402344, time spent:170.80491828918457s None\n",
      " idx:2970, loss:980.7271728515625, time spent:171.51801347732544s None\n",
      " idx:2980, loss:664.0901489257812, time spent:172.21448945999146s None\n",
      " idx:2990, loss:105.51311492919922, time spent:172.26593279838562s None\n",
      " idx:3000, loss:592.003662109375, time spent:172.59463119506836s None\n",
      " idx:3010, loss:922.9996948242188, time spent:174.379723072052s None\n",
      " idx:3020, loss:1606.7349853515625, time spent:180.24392461776733s None\n",
      " idx:3030, loss:932.9951782226562, time spent:181.21335196495056s None\n",
      " idx:3040, loss:75.19184875488281, time spent:181.2484152317047s None\n",
      " idx:3050, loss:422.39666748046875, time spent:181.47030639648438s None\n",
      " idx:3060, loss:917.4970703125, time spent:182.0616738796234s None\n",
      " idx:3070, loss:334.87860107421875, time spent:183.17048621177673s None\n",
      " idx:3080, loss:277.1435546875, time spent:183.38105273246765s None\n",
      " idx:3090, loss:185.65023803710938, time spent:183.52342176437378s None\n",
      " idx:3100, loss:406.3143615722656, time spent:184.3827075958252s None\n",
      " idx:3110, loss:276.3645324707031, time spent:185.46344232559204s None\n",
      " idx:3120, loss:1124.614990234375, time spent:186.19409227371216s None\n",
      " idx:3130, loss:456.8436279296875, time spent:186.45580744743347s None\n",
      " idx:3140, loss:226.97792053222656, time spent:186.56544399261475s None\n",
      " idx:3150, loss:785.1197509765625, time spent:187.2287187576294s None\n",
      " idx:3160, loss:275.1295471191406, time spent:187.37315917015076s None\n",
      " idx:3170, loss:223.9741668701172, time spent:187.59458708763123s None\n",
      " idx:3180, loss:506.80780029296875, time spent:188.15262651443481s None\n",
      " idx:3190, loss:526.1055908203125, time spent:188.635023355484s None\n",
      " idx:3200, loss:306.6112060546875, time spent:188.89662790298462s None\n",
      " idx:3210, loss:435.7496032714844, time spent:189.66509890556335s None\n",
      " idx:3220, loss:740.3945922851562, time spent:190.45540308952332s None\n",
      " idx:3230, loss:254.32305908203125, time spent:190.73164534568787s None\n",
      " idx:3240, loss:1651.578369140625, time spent:192.12899374961853s None\n",
      " idx:3250, loss:991.9012451171875, time spent:192.5336630344391s None\n",
      " idx:3260, loss:1003.2089233398438, time spent:193.61673545837402s None\n",
      " idx:3270, loss:1533.991455078125, time spent:194.84790420532227s None\n",
      " idx:3280, loss:437.31610107421875, time spent:195.3124635219574s None\n",
      " idx:3290, loss:403.1943664550781, time spent:195.55715584754944s None\n",
      " idx:3300, loss:389.46319580078125, time spent:195.83335041999817s None\n",
      " idx:3310, loss:834.4251708984375, time spent:196.40500354766846s None\n",
      " idx:3320, loss:172.65145874023438, time spent:197.657066822052s None\n",
      " idx:3330, loss:633.9727783203125, time spent:198.21875047683716s None\n",
      " idx:3340, loss:358.9427490234375, time spent:198.73324608802795s None\n",
      " idx:3350, loss:367.22265625, time spent:198.89764380455017s None\n",
      " idx:3360, loss:1567.6041259765625, time spent:200.09530544281006s None\n",
      " idx:3370, loss:1615.0843505859375, time spent:200.88299345970154s None\n",
      " idx:3373, loss:64.67182159423828, time spent:200.97148251533508s None\n",
      "(101508,)\n",
      "(101508,)\n",
      "(101508,)\n",
      "\n",
      " auc=0.8296690994891589, accuracy=0.7758698821767742, precision=[ 0.75842156  0.78008243], recall=[ 0.45433028  0.9304344 ]\n",
      " idx:10, loss:116.92965698242188, time spent:0.09563660621643066s None\n",
      " idx:20, loss:381.8646240234375, time spent:0.3068828582763672s None\n",
      " idx:30, loss:424.5145568847656, time spent:2.444981336593628s None\n",
      " idx:40, loss:132.6954345703125, time spent:3.0436172485351562s None\n",
      " idx:50, loss:171.40869140625, time spent:3.1101338863372803s None\n",
      " idx:60, loss:348.1571044921875, time spent:3.223398208618164s None\n",
      " idx:70, loss:1036.068359375, time spent:4.0170722007751465s None\n",
      " idx:80, loss:584.9465942382812, time spent:4.968206167221069s None\n",
      " idx:90, loss:212.3255615234375, time spent:5.067777156829834s None\n",
      " idx:100, loss:997.1322021484375, time spent:6.196195840835571s None\n",
      " idx:110, loss:437.7271423339844, time spent:6.482768535614014s None\n",
      " idx:120, loss:309.49951171875, time spent:6.683365345001221s None\n",
      " idx:130, loss:180.387451171875, time spent:6.9202611446380615s None\n",
      " idx:140, loss:188.70706176757812, time spent:7.887019634246826s None\n",
      " idx:150, loss:483.5159912109375, time spent:8.53035855293274s None\n",
      " idx:160, loss:280.90325927734375, time spent:8.677901983261108s None\n",
      " idx:170, loss:1460.76123046875, time spent:9.988515138626099s None\n",
      " idx:180, loss:231.3699951171875, time spent:10.112557888031006s None\n",
      " idx:190, loss:505.77435302734375, time spent:11.088537216186523s None\n",
      " idx:200, loss:242.83966064453125, time spent:11.244115114212036s None\n",
      " idx:210, loss:285.19659423828125, time spent:11.38835883140564s None\n",
      " idx:220, loss:980.109375, time spent:12.602901458740234s None\n",
      " idx:230, loss:1218.9736328125, time spent:13.423136949539185s None\n",
      " idx:240, loss:406.10003662109375, time spent:13.693485021591187s None\n",
      " idx:250, loss:1228.730224609375, time spent:14.473325252532959s None\n",
      " idx:260, loss:149.13194274902344, time spent:14.581148147583008s None\n",
      " idx:270, loss:1099.630615234375, time spent:15.145634889602661s None\n",
      " idx:280, loss:1060.7906494140625, time spent:15.849675416946411s None\n",
      " idx:290, loss:649.1190185546875, time spent:16.25114393234253s None\n",
      " idx:300, loss:301.299560546875, time spent:16.587464332580566s None\n",
      " idx:310, loss:367.30859375, time spent:16.839271306991577s None\n",
      " idx:320, loss:956.8270263671875, time spent:17.469119548797607s None\n",
      " idx:330, loss:1138.6217041015625, time spent:17.99657368659973s None\n",
      " idx:340, loss:1332.1162109375, time spent:19.39016604423523s None\n",
      " idx:350, loss:776.7072143554688, time spent:20.201814651489258s None\n",
      " idx:360, loss:311.7604064941406, time spent:20.55037784576416s None\n",
      " idx:370, loss:173.04714965820312, time spent:20.609819889068604s None\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " idx:380, loss:687.5408325195312, time spent:21.9456045627594s None\n",
      " idx:390, loss:286.572509765625, time spent:22.76778221130371s None\n",
      " idx:400, loss:157.32102966308594, time spent:22.848662853240967s None\n",
      " idx:410, loss:356.65032958984375, time spent:23.007899522781372s None\n",
      " idx:420, loss:771.5635986328125, time spent:23.738478422164917s None\n",
      " idx:430, loss:1010.8618774414062, time spent:24.78722906112671s None\n",
      " idx:440, loss:198.801513671875, time spent:24.929698944091797s None\n",
      " idx:450, loss:328.73675537109375, time spent:25.521129846572876s None\n",
      " idx:460, loss:355.1948547363281, time spent:25.70844316482544s None\n",
      " idx:470, loss:159.5861053466797, time spent:25.765715837478638s None\n",
      " idx:480, loss:1689.6185302734375, time spent:26.88099503517151s None\n",
      " idx:490, loss:417.24835205078125, time spent:27.18049693107605s None\n",
      " idx:500, loss:239.5913848876953, time spent:27.3864004611969s None\n",
      " idx:510, loss:679.0472412109375, time spent:28.068891763687134s None\n",
      " idx:520, loss:113.27340698242188, time spent:28.119033336639404s None\n",
      " idx:530, loss:227.51760864257812, time spent:28.223220825195312s None\n",
      " idx:540, loss:754.8292236328125, time spent:28.89480471611023s None\n",
      " idx:550, loss:556.805908203125, time spent:29.46127963066101s None\n",
      " idx:560, loss:717.7118530273438, time spent:30.15153455734253s None\n",
      " idx:570, loss:729.9808349609375, time spent:30.875049114227295s None\n",
      " idx:580, loss:759.8748168945312, time spent:31.657042503356934s None\n",
      " idx:590, loss:998.2794189453125, time spent:33.87589454650879s None\n",
      " idx:600, loss:261.38287353515625, time spent:34.119378089904785s None\n",
      " idx:610, loss:1451.262451171875, time spent:35.355029344558716s None\n",
      " idx:620, loss:193.2635040283203, time spent:35.42731285095215s None\n",
      " idx:630, loss:973.1878051757812, time spent:36.437366247177124s None\n",
      " idx:640, loss:1243.1466064453125, time spent:41.76948022842407s None\n",
      " idx:650, loss:473.7148132324219, time spent:41.974467277526855s None\n",
      " idx:660, loss:273.357421875, time spent:42.169881105422974s None\n",
      " idx:670, loss:516.5488891601562, time spent:42.530972957611084s None\n",
      " idx:680, loss:271.87078857421875, time spent:42.7619514465332s None\n",
      " idx:690, loss:902.300537109375, time spent:43.4909565448761s None\n",
      " idx:700, loss:179.67724609375, time spent:43.67512392997742s None\n",
      " idx:710, loss:1254.64892578125, time spent:44.67019319534302s None\n",
      " idx:720, loss:743.1646118164062, time spent:45.58609962463379s None\n",
      " idx:730, loss:368.5041198730469, time spent:45.80967593193054s None\n",
      " idx:740, loss:382.661865234375, time spent:47.045610189437866s None\n",
      " idx:750, loss:262.6585693359375, time spent:47.228612184524536s None\n",
      " idx:760, loss:1344.449462890625, time spent:48.21316432952881s None\n",
      " idx:770, loss:438.91009521484375, time spent:48.45970416069031s None\n",
      " idx:780, loss:285.9302673339844, time spent:48.68657064437866s None\n",
      " idx:790, loss:115.76001739501953, time spent:48.72600984573364s None\n",
      " idx:800, loss:1442.050048828125, time spent:50.07105875015259s None\n",
      " idx:810, loss:663.8250732421875, time spent:50.498385429382324s None\n",
      " idx:820, loss:141.64752197265625, time spent:50.553184270858765s None\n",
      " idx:830, loss:1419.745361328125, time spent:51.57277274131775s None\n",
      " idx:840, loss:655.231689453125, time spent:52.13438630104065s None\n",
      " idx:850, loss:891.5765380859375, time spent:52.675437688827515s None\n",
      " idx:860, loss:284.76422119140625, time spent:53.71449327468872s None\n",
      " idx:870, loss:301.6048583984375, time spent:53.79907298088074s None\n",
      " idx:880, loss:325.41632080078125, time spent:53.946523904800415s None\n",
      " idx:890, loss:462.4801025390625, time spent:54.21017575263977s None\n",
      " idx:900, loss:216.99476623535156, time spent:55.285797119140625s None\n",
      " idx:910, loss:171.426513671875, time spent:56.834477186203s None\n",
      " idx:920, loss:304.30108642578125, time spent:57.02745342254639s None\n",
      " idx:930, loss:207.6975555419922, time spent:58.20832014083862s None\n",
      " idx:940, loss:397.9022521972656, time spent:58.55280065536499s None\n",
      " idx:950, loss:1048.33154296875, time spent:59.35710287094116s None\n",
      " idx:960, loss:356.417236328125, time spent:59.726850748062134s None\n",
      " idx:970, loss:127.58423614501953, time spent:59.783275842666626s None\n",
      " idx:980, loss:404.1364440917969, time spent:59.90729212760925s None\n",
      " idx:990, loss:1416.753662109375, time spent:60.85522532463074s None\n",
      " idx:1000, loss:680.4542236328125, time spent:61.550801038742065s None\n",
      " idx:1010, loss:46.74405288696289, time spent:61.571000814437866s None\n",
      " idx:1020, loss:465.708251953125, time spent:61.72610855102539s None\n",
      " idx:1030, loss:1374.290771484375, time spent:62.840898752212524s None\n",
      " idx:1040, loss:589.1827392578125, time spent:63.52773141860962s None\n",
      " idx:1050, loss:853.416259765625, time spent:64.38350439071655s None\n",
      " idx:1060, loss:462.6678466796875, time spent:64.59411072731018s None\n",
      " idx:1070, loss:1323.563232421875, time spent:65.65615844726562s None\n",
      " idx:1080, loss:305.4410400390625, time spent:65.88460659980774s None\n",
      " idx:1090, loss:904.681396484375, time spent:66.40122103691101s None\n",
      " idx:1100, loss:239.8426513671875, time spent:66.51372289657593s None\n",
      " idx:1110, loss:585.4358520507812, time spent:66.97995519638062s None\n",
      " idx:1120, loss:470.8832702636719, time spent:67.51477026939392s None\n",
      " idx:1130, loss:187.82427978515625, time spent:67.61922597885132s None\n",
      " idx:1140, loss:223.4356231689453, time spent:67.75615549087524s None\n",
      " idx:1150, loss:1156.127197265625, time spent:68.78268647193909s None\n",
      " idx:1160, loss:277.7711486816406, time spent:69.07073926925659s None\n",
      " idx:1170, loss:607.4589233398438, time spent:69.38700270652771s None\n",
      " idx:1180, loss:717.66748046875, time spent:69.96146178245544s None\n",
      " idx:1190, loss:1108.420166015625, time spent:70.8326313495636s None\n",
      " idx:1200, loss:69.36788177490234, time spent:70.91373896598816s None\n",
      " idx:1210, loss:527.983154296875, time spent:71.44586777687073s None\n",
      " idx:1220, loss:256.44219970703125, time spent:71.56511950492859s None\n",
      " idx:1230, loss:776.4855346679688, time spent:72.34894704818726s None\n",
      " idx:1240, loss:303.9578857421875, time spent:72.61715030670166s None\n",
      " idx:1250, loss:885.3167114257812, time spent:73.56372785568237s None\n",
      " idx:1260, loss:417.22296142578125, time spent:74.41865372657776s None\n",
      " idx:1270, loss:883.1715087890625, time spent:75.32536339759827s None\n",
      " idx:1280, loss:223.71963500976562, time spent:75.78324007987976s None\n",
      " idx:1290, loss:513.8651733398438, time spent:76.2119951248169s None\n",
      " idx:1300, loss:1250.3636474609375, time spent:77.06188130378723s None\n",
      " idx:1310, loss:647.8051147460938, time spent:77.62098383903503s None\n",
      " idx:1320, loss:233.42298889160156, time spent:77.77520775794983s None\n",
      " idx:1330, loss:276.4745178222656, time spent:78.4870138168335s None\n",
      " idx:1340, loss:92.02350616455078, time spent:78.52957463264465s None\n",
      " idx:1350, loss:939.0146484375, time spent:79.29365539550781s None\n",
      " idx:1360, loss:197.14013671875, time spent:79.35835790634155s None\n",
      " idx:1370, loss:303.2771911621094, time spent:79.50756859779358s None\n",
      " idx:1380, loss:382.4610595703125, time spent:79.81737732887268s None\n",
      " idx:1390, loss:1498.5745849609375, time spent:80.99434804916382s None\n",
      " idx:1400, loss:549.0532836914062, time spent:82.04545545578003s None\n",
      " idx:1410, loss:379.79852294921875, time spent:83.68643355369568s None\n",
      " idx:1420, loss:707.163818359375, time spent:84.20943021774292s None\n",
      " idx:1430, loss:767.2890014648438, time spent:85.00443983078003s None\n",
      " idx:1440, loss:509.5425109863281, time spent:85.62004494667053s None\n",
      " idx:1450, loss:212.8394775390625, time spent:85.74866557121277s None\n",
      " idx:1460, loss:337.6715393066406, time spent:85.95731377601624s None\n",
      " idx:1470, loss:495.8301086425781, time spent:86.28306221961975s None\n",
      " idx:1480, loss:675.387939453125, time spent:86.65682625770569s None\n",
      " idx:1490, loss:663.7962646484375, time spent:87.29894828796387s None\n",
      " idx:1500, loss:715.997314453125, time spent:87.71665740013123s None\n",
      " idx:1510, loss:703.0755615234375, time spent:88.05642986297607s None\n",
      " idx:1520, loss:691.2613525390625, time spent:89.44594550132751s None\n",
      " idx:1530, loss:1648.18359375, time spent:90.38451981544495s None\n",
      " idx:1540, loss:301.5469665527344, time spent:90.60973834991455s None\n",
      " idx:1550, loss:490.2185363769531, time spent:91.69017100334167s None\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " idx:1560, loss:499.41094970703125, time spent:92.32875776290894s None\n",
      " idx:1570, loss:637.1234741210938, time spent:93.03007650375366s None\n",
      " idx:1580, loss:584.3298950195312, time spent:93.63779091835022s None\n",
      " idx:1590, loss:1268.532470703125, time spent:94.50250363349915s None\n",
      " idx:1600, loss:301.98779296875, time spent:94.68514132499695s None\n",
      " idx:1610, loss:387.2406311035156, time spent:94.91223120689392s None\n",
      " idx:1620, loss:254.57418823242188, time spent:95.40738344192505s None\n",
      " idx:1630, loss:1321.1787109375, time spent:96.19177079200745s None\n",
      " idx:1640, loss:412.93292236328125, time spent:96.38940119743347s None\n",
      " idx:1650, loss:341.48455810546875, time spent:96.81954288482666s None\n",
      " idx:1660, loss:360.3186950683594, time spent:96.97041535377502s None\n",
      " idx:1670, loss:727.785888671875, time spent:97.72850322723389s None\n",
      " idx:1680, loss:536.11767578125, time spent:98.36602878570557s None\n",
      " idx:1690, loss:762.5078125, time spent:98.93793320655823s None\n",
      " idx:1700, loss:587.8531494140625, time spent:99.20272183418274s None\n",
      " idx:1710, loss:247.60601806640625, time spent:99.41337251663208s None\n",
      " idx:1720, loss:1030.675048828125, time spent:100.19849801063538s None\n",
      " idx:1730, loss:260.3170471191406, time spent:100.38488793373108s None\n",
      " idx:1740, loss:1149.2586669921875, time spent:101.51766419410706s None\n",
      " idx:1750, loss:410.8897399902344, time spent:101.99133276939392s None\n",
      " idx:1760, loss:463.28582763671875, time spent:102.21320128440857s None\n",
      " idx:1770, loss:168.36448669433594, time spent:102.2751452922821s None\n",
      " idx:1780, loss:662.638671875, time spent:102.9523138999939s None\n",
      " idx:1790, loss:689.6909790039062, time spent:103.72193789482117s None\n",
      " idx:1800, loss:518.5831298828125, time spent:104.322425365448s None\n",
      " idx:1810, loss:375.89892578125, time spent:104.69095468521118s None\n",
      " idx:1820, loss:361.79156494140625, time spent:104.87603735923767s None\n",
      " idx:1830, loss:417.519287109375, time spent:105.17064666748047s None\n",
      " idx:1840, loss:271.3559265136719, time spent:105.33515667915344s None\n",
      " idx:1850, loss:1530.8095703125, time spent:106.14566040039062s None\n",
      " idx:1860, loss:398.23236083984375, time spent:106.42301034927368s None\n",
      " idx:1870, loss:719.4751586914062, time spent:107.06007361412048s None\n",
      " idx:1880, loss:1301.0133056640625, time spent:107.97119855880737s None\n",
      " idx:1890, loss:1318.643310546875, time spent:109.10878252983093s None\n",
      " idx:1900, loss:353.82147216796875, time spent:109.23765587806702s None\n",
      " idx:1910, loss:562.1636962890625, time spent:109.5662350654602s None\n",
      " idx:1920, loss:269.2928161621094, time spent:109.73373174667358s None\n",
      " idx:1930, loss:283.576171875, time spent:109.96736693382263s None\n",
      " idx:1940, loss:1073.0810546875, time spent:110.84509587287903s None\n",
      " idx:1950, loss:634.51708984375, time spent:111.57524991035461s None\n",
      " idx:1960, loss:575.8827514648438, time spent:112.82348251342773s None\n",
      " idx:1970, loss:357.6968688964844, time spent:113.10078001022339s None\n",
      " idx:1980, loss:211.2567596435547, time spent:113.21609401702881s None\n",
      " idx:1990, loss:1259.6717529296875, time spent:114.21724700927734s None\n",
      " idx:2000, loss:864.322998046875, time spent:115.36211729049683s None\n",
      " idx:2010, loss:1037.8848876953125, time spent:116.20303702354431s None\n",
      " idx:2020, loss:181.3624725341797, time spent:116.31648778915405s None\n",
      " idx:2030, loss:778.0615234375, time spent:116.95400547981262s None\n",
      " idx:2040, loss:184.11752319335938, time spent:117.82665228843689s None\n",
      " idx:2050, loss:115.96900939941406, time spent:117.89099073410034s None\n",
      " idx:2060, loss:988.8153686523438, time spent:118.65038204193115s None\n",
      " idx:2070, loss:745.0687866210938, time spent:119.51820302009583s None\n",
      " idx:2080, loss:171.3522186279297, time spent:119.6230194568634s None\n",
      " idx:2090, loss:1135.1744384765625, time spent:120.86521792411804s None\n",
      " idx:2100, loss:128.20912170410156, time spent:120.95162582397461s None\n",
      " idx:2110, loss:319.76507568359375, time spent:121.31930661201477s None\n",
      " idx:2120, loss:172.20138549804688, time spent:121.40175724029541s None\n",
      " idx:2130, loss:305.8812255859375, time spent:121.58197665214539s None\n",
      " idx:2140, loss:704.6607055664062, time spent:122.11093187332153s None\n",
      " idx:2150, loss:750.3798217773438, time spent:122.63646531105042s None\n",
      " idx:2160, loss:325.8730163574219, time spent:122.74053263664246s None\n",
      " idx:2170, loss:181.28347778320312, time spent:122.84254574775696s None\n",
      " idx:2180, loss:197.7592315673828, time spent:122.99023938179016s None\n",
      " idx:2190, loss:1254.240478515625, time spent:123.76735329627991s None\n",
      " idx:2200, loss:282.7191162109375, time spent:123.8924560546875s None\n",
      " idx:2210, loss:491.5780029296875, time spent:124.12929821014404s None\n",
      " idx:2220, loss:161.1273193359375, time spent:124.78576517105103s None\n",
      " idx:2230, loss:880.0258178710938, time spent:125.35860514640808s None\n",
      " idx:2240, loss:998.7275390625, time spent:126.20791673660278s None\n",
      " idx:2250, loss:1449.3890380859375, time spent:127.16992735862732s None\n",
      " idx:2260, loss:582.3694458007812, time spent:128.34190678596497s None\n",
      " idx:2270, loss:747.7192993164062, time spent:128.9151816368103s None\n",
      " idx:2280, loss:831.9021606445312, time spent:129.36007261276245s None\n",
      " idx:2290, loss:668.7929077148438, time spent:129.76255440711975s None\n",
      " idx:2300, loss:820.5499267578125, time spent:130.36171746253967s None\n",
      " idx:2310, loss:148.31683349609375, time spent:131.6380660533905s None\n",
      " idx:2320, loss:297.119140625, time spent:131.84228515625s None\n",
      " idx:2330, loss:172.87460327148438, time spent:132.12056756019592s None\n",
      " idx:2340, loss:390.2767333984375, time spent:132.46864318847656s None\n",
      " idx:2350, loss:369.524169921875, time spent:133.06192636489868s None\n",
      " idx:2360, loss:778.9028930664062, time spent:133.63959217071533s None\n",
      " idx:2370, loss:894.791748046875, time spent:134.53856658935547s None\n",
      " idx:2380, loss:188.941162109375, time spent:134.5866186618805s None\n",
      " idx:2390, loss:163.8050994873047, time spent:134.65767073631287s None\n",
      " idx:2400, loss:309.5318603515625, time spent:135.37143111228943s None\n",
      " idx:2410, loss:226.61941528320312, time spent:135.45162296295166s None\n",
      " idx:2420, loss:397.8841552734375, time spent:135.66218829154968s None\n",
      " idx:2430, loss:656.8094482421875, time spent:136.31686091423035s None\n",
      " idx:2440, loss:675.7274780273438, time spent:136.91861748695374s None\n",
      " idx:2450, loss:488.1831970214844, time spent:137.92120695114136s None\n",
      " idx:2460, loss:138.61854553222656, time spent:138.81319189071655s None\n",
      " idx:2470, loss:172.65277099609375, time spent:138.90263533592224s None\n",
      " idx:2480, loss:1029.9271240234375, time spent:139.92379331588745s None\n",
      " idx:2490, loss:465.6048583984375, time spent:140.12254238128662s None\n",
      " idx:2500, loss:251.30264282226562, time spent:140.3084044456482s None\n",
      " idx:2510, loss:88.3167724609375, time spent:140.3477234840393s None\n",
      " idx:2520, loss:173.9127960205078, time spent:140.51807284355164s None\n",
      " idx:2530, loss:179.96202087402344, time spent:140.6258201599121s None\n",
      " idx:2540, loss:659.2686767578125, time spent:141.20069813728333s None\n",
      " idx:2550, loss:495.86663818359375, time spent:141.4801197052002s None\n",
      " idx:2560, loss:355.9200134277344, time spent:141.74778175354004s None\n",
      " idx:2570, loss:483.8492736816406, time spent:141.97726726531982s None\n",
      " idx:2580, loss:160.34619140625, time spent:142.0877046585083s None\n",
      " idx:2590, loss:545.4830932617188, time spent:143.15468883514404s None\n",
      " idx:2600, loss:1498.1905517578125, time spent:144.58455157279968s None\n",
      " idx:2610, loss:374.34814453125, time spent:144.8244071006775s None\n",
      " idx:2620, loss:140.55213928222656, time spent:145.53895163536072s None\n",
      " idx:2630, loss:1566.6983642578125, time spent:146.41092610359192s None\n",
      " idx:2640, loss:236.60122680664062, time spent:146.56389713287354s None\n",
      " idx:2650, loss:821.0233154296875, time spent:147.3885715007782s None\n",
      " idx:2660, loss:774.5299682617188, time spent:148.26148796081543s None\n",
      " idx:2670, loss:610.5370483398438, time spent:149.06517839431763s None\n",
      " idx:2680, loss:932.45458984375, time spent:149.95964860916138s None\n",
      " idx:2690, loss:663.0638427734375, time spent:150.46494555473328s None\n",
      " idx:2700, loss:310.2716979980469, time spent:150.66967606544495s None\n",
      " idx:2710, loss:812.8297729492188, time spent:151.40326619148254s None\n",
      " idx:2720, loss:993.2539672851562, time spent:152.19170141220093s None\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " idx:2730, loss:379.95477294921875, time spent:152.41681337356567s None\n",
      " idx:2740, loss:606.5303344726562, time spent:152.66905212402344s None\n",
      " idx:2750, loss:201.6486358642578, time spent:152.74929976463318s None\n",
      " idx:2760, loss:339.46453857421875, time spent:152.99645519256592s None\n",
      " idx:2770, loss:1347.778076171875, time spent:153.72659015655518s None\n",
      " idx:2780, loss:289.2571716308594, time spent:153.88097524642944s None\n",
      " idx:2790, loss:260.98046875, time spent:154.59164786338806s None\n",
      " idx:2800, loss:670.0189208984375, time spent:155.58402919769287s None\n",
      " idx:2810, loss:214.95309448242188, time spent:155.8772099018097s None\n",
      " idx:2820, loss:205.2705841064453, time spent:156.60144090652466s None\n",
      " idx:2830, loss:560.436279296875, time spent:156.82201838493347s None\n",
      " idx:2840, loss:157.8976287841797, time spent:156.8965368270874s None\n",
      " idx:2850, loss:556.0476684570312, time spent:157.58346843719482s None\n",
      " idx:2860, loss:1287.6324462890625, time spent:158.5136525630951s None\n",
      " idx:2870, loss:215.18710327148438, time spent:158.66206884384155s None\n",
      " idx:2880, loss:263.2669982910156, time spent:159.37162399291992s None\n",
      " idx:2890, loss:579.2705078125, time spent:160.0388424396515s None\n",
      " idx:2900, loss:784.492431640625, time spent:161.48574137687683s None\n",
      " idx:2910, loss:693.10205078125, time spent:161.95318794250488s None\n",
      " idx:2920, loss:966.4954833984375, time spent:163.01337814331055s None\n",
      " idx:2930, loss:352.6884460449219, time spent:163.205144405365s None\n",
      " idx:2940, loss:557.3432006835938, time spent:163.88933897018433s None\n",
      " idx:2950, loss:421.010009765625, time spent:164.20409417152405s None\n",
      " idx:2960, loss:64.27708435058594, time spent:164.2486927509308s None\n",
      " idx:2970, loss:525.2625122070312, time spent:165.3517484664917s None\n",
      " idx:2980, loss:1248.3192138671875, time spent:166.05161571502686s None\n",
      " idx:2990, loss:721.6757202148438, time spent:166.84886717796326s None\n",
      " idx:3000, loss:326.9704284667969, time spent:167.5132884979248s None\n",
      " idx:3010, loss:476.1444091796875, time spent:167.7767367362976s None\n",
      " idx:3020, loss:352.881103515625, time spent:167.98776245117188s None\n",
      " idx:3030, loss:158.20484924316406, time spent:168.96968841552734s None\n",
      " idx:3040, loss:303.4084777832031, time spent:170.0213656425476s None\n",
      " idx:3050, loss:1440.0477294921875, time spent:172.56695580482483s None\n",
      " idx:3060, loss:445.96392822265625, time spent:173.07423996925354s None\n",
      " idx:3070, loss:312.8856506347656, time spent:173.86978578567505s None\n",
      " idx:3080, loss:581.2364501953125, time spent:174.1116054058075s None\n",
      " idx:3090, loss:378.2463073730469, time spent:174.27009224891663s None\n",
      " idx:3100, loss:306.2116394042969, time spent:174.5119912624359s None\n",
      " idx:3110, loss:1762.6055908203125, time spent:175.57762122154236s None\n",
      " idx:3120, loss:239.75772094726562, time spent:175.76807641983032s None\n",
      " idx:3130, loss:1421.670166015625, time spent:181.38247680664062s None\n",
      " idx:3140, loss:725.2129516601562, time spent:182.41733026504517s None\n",
      " idx:3150, loss:174.10157775878906, time spent:182.53753113746643s None\n",
      " idx:3160, loss:431.1666564941406, time spent:182.9630126953125s None\n",
      " idx:3170, loss:788.5543823242188, time spent:183.90063381195068s None\n",
      " idx:3180, loss:371.57489013671875, time spent:185.28915524482727s None\n",
      " idx:3190, loss:252.1846160888672, time spent:186.8739881515503s None\n",
      " idx:3200, loss:288.9580078125, time spent:187.06346654891968s None\n",
      " idx:3210, loss:491.1737365722656, time spent:187.4099109172821s None\n",
      " idx:3220, loss:1181.2294921875, time spent:188.20476627349854s None\n",
      " idx:3230, loss:198.29183959960938, time spent:188.3631603717804s None\n",
      " idx:3240, loss:395.19622802734375, time spent:188.77672743797302s None\n",
      " idx:3250, loss:390.6637268066406, time spent:189.4088957309723s None\n",
      " idx:3260, loss:343.29083251953125, time spent:189.71212434768677s None\n",
      " idx:3270, loss:797.5023193359375, time spent:190.52975034713745s None\n",
      " idx:3280, loss:981.4862670898438, time spent:191.8302764892578s None\n",
      " idx:3290, loss:1053.1331787109375, time spent:192.82110857963562s None\n",
      " idx:3300, loss:400.72515869140625, time spent:193.0812304019928s None\n",
      " idx:3310, loss:451.62457275390625, time spent:193.43055701255798s None\n",
      " idx:3320, loss:476.7100524902344, time spent:193.78331804275513s None\n",
      " idx:3330, loss:746.06787109375, time spent:194.62084531784058s None\n",
      " idx:3340, loss:300.53338623046875, time spent:194.90252304077148s None\n",
      " idx:3350, loss:104.1553955078125, time spent:194.97325801849365s None\n",
      " idx:3360, loss:1445.5570068359375, time spent:196.14784789085388s None\n",
      " idx:3370, loss:529.1726684570312, time spent:196.60773468017578s None\n",
      " idx:3373, loss:144.82643127441406, time spent:196.823588848114s None\n",
      "(101508,)\n",
      "(101508,)\n",
      "(101508,)\n",
      "\n",
      " auc=0.8249153334134621, accuracy=0.7780569019190605, precision=[ 0.7612651   0.78216462], recall=[ 0.46088487  0.93052192]\n",
      " idx:10, loss:797.7630004882812, time spent:0.8610615730285645s None\n",
      " idx:20, loss:1484.421875, time spent:1.8267877101898193s None\n",
      " idx:30, loss:555.3838500976562, time spent:2.3076906204223633s None\n",
      " idx:40, loss:872.2819213867188, time spent:3.024858236312866s None\n",
      " idx:50, loss:706.0797729492188, time spent:3.77827787399292s None\n",
      " idx:60, loss:282.7789001464844, time spent:3.9360904693603516s None\n",
      " idx:70, loss:305.34161376953125, time spent:4.124863624572754s None\n",
      " idx:80, loss:334.38922119140625, time spent:5.067884206771851s None\n",
      " idx:90, loss:392.7765808105469, time spent:5.3454790115356445s None\n",
      " idx:100, loss:353.633544921875, time spent:5.519806623458862s None\n",
      " idx:110, loss:229.50787353515625, time spent:5.697819232940674s None\n",
      " idx:120, loss:562.752685546875, time spent:6.028071880340576s None\n",
      " idx:130, loss:421.5359191894531, time spent:6.46211314201355s None\n",
      " idx:140, loss:358.8960876464844, time spent:7.420324325561523s None\n",
      " idx:150, loss:658.4051513671875, time spent:8.204445362091064s None\n",
      " idx:160, loss:618.3196411132812, time spent:9.392460346221924s None\n",
      " idx:170, loss:221.91659545898438, time spent:9.546152591705322s None\n",
      " idx:180, loss:216.5624542236328, time spent:9.690097093582153s None\n",
      " idx:190, loss:229.52407836914062, time spent:9.743091821670532s None\n",
      " idx:200, loss:719.3966674804688, time spent:10.518733978271484s None\n",
      " idx:210, loss:687.7872314453125, time spent:11.128649950027466s None\n",
      " idx:220, loss:271.3221435546875, time spent:12.405692338943481s None\n",
      " idx:230, loss:340.4182434082031, time spent:12.657836675643921s None\n",
      " idx:240, loss:470.8522033691406, time spent:12.949259757995605s None\n",
      " idx:250, loss:467.5474853515625, time spent:13.37503433227539s None\n",
      " idx:260, loss:786.4352416992188, time spent:13.962493658065796s None\n",
      " idx:270, loss:882.0158081054688, time spent:14.411165237426758s None\n",
      " idx:280, loss:613.6744384765625, time spent:14.772475004196167s None\n",
      " idx:290, loss:211.8722381591797, time spent:14.96845269203186s None\n",
      " idx:300, loss:141.0828857421875, time spent:15.099284648895264s None\n",
      " idx:310, loss:203.74513244628906, time spent:15.31714153289795s None\n",
      " idx:320, loss:588.8233642578125, time spent:15.903233289718628s None\n",
      " idx:330, loss:1328.6318359375, time spent:17.054112195968628s None\n",
      " idx:340, loss:77.2222900390625, time spent:17.09498953819275s None\n",
      " idx:350, loss:449.1820373535156, time spent:17.461498022079468s None\n",
      " idx:360, loss:295.9376525878906, time spent:17.678632736206055s None\n",
      " idx:370, loss:967.6390380859375, time spent:18.787402153015137s None\n",
      " idx:380, loss:319.0281066894531, time spent:19.08827018737793s None\n",
      " idx:390, loss:635.3109741210938, time spent:19.796318531036377s None\n",
      " idx:400, loss:487.8789978027344, time spent:19.955902099609375s None\n",
      " idx:410, loss:363.70123291015625, time spent:20.308324337005615s None\n",
      " idx:420, loss:784.6709594726562, time spent:21.264755487442017s None\n",
      " idx:430, loss:414.72174072265625, time spent:21.47916007041931s None\n",
      " idx:440, loss:820.2183227539062, time spent:22.442272663116455s None\n",
      " idx:450, loss:606.3328857421875, time spent:22.9550838470459s None\n",
      " idx:460, loss:1066.6912841796875, time spent:23.532132387161255s None\n",
      " idx:470, loss:492.98223876953125, time spent:23.70623779296875s None\n",
      " idx:480, loss:444.5746765136719, time spent:24.34378981590271s None\n",
      " idx:490, loss:334.18603515625, time spent:25.67086124420166s None\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " idx:500, loss:429.8442077636719, time spent:26.094717025756836s None\n",
      " idx:510, loss:377.2572021484375, time spent:26.35595202445984s None\n",
      " idx:520, loss:827.9777221679688, time spent:27.458606719970703s None\n",
      " idx:530, loss:219.4903564453125, time spent:27.705005884170532s None\n",
      " idx:540, loss:760.0774536132812, time spent:28.305418729782104s None\n",
      " idx:550, loss:1140.6829833984375, time spent:29.342132091522217s None\n",
      " idx:560, loss:537.9119873046875, time spent:29.64002013206482s None\n",
      " idx:570, loss:648.543701171875, time spent:30.51952338218689s None\n",
      " idx:580, loss:279.8776550292969, time spent:30.6615948677063s None\n",
      " idx:590, loss:846.8961181640625, time spent:31.617297887802124s None\n",
      " idx:600, loss:745.362060546875, time spent:32.37601661682129s None\n",
      " idx:610, loss:294.7541198730469, time spent:32.482248306274414s None\n",
      " idx:620, loss:277.0596923828125, time spent:33.66624569892883s None\n",
      " idx:630, loss:1161.827392578125, time spent:34.438621044158936s None\n",
      " idx:640, loss:260.2685241699219, time spent:34.55064010620117s None\n",
      " idx:650, loss:87.14283752441406, time spent:34.853461265563965s None\n",
      " idx:660, loss:756.2756958007812, time spent:35.37519717216492s None\n",
      " idx:670, loss:355.53057861328125, time spent:35.54333472251892s None\n",
      " idx:680, loss:451.8318786621094, time spent:35.799532890319824s None\n",
      " idx:690, loss:997.0758666992188, time spent:36.97768807411194s None\n",
      " idx:700, loss:338.718017578125, time spent:38.02398610115051s None\n",
      " idx:710, loss:219.03030395507812, time spent:38.77450776100159s None\n",
      " idx:720, loss:369.3786926269531, time spent:39.134350299835205s None\n",
      " idx:730, loss:291.499267578125, time spent:39.37477684020996s None\n",
      " idx:740, loss:737.6328125, time spent:40.051937103271484s None\n",
      " idx:750, loss:1512.6767578125, time spent:40.90585684776306s None\n",
      " idx:760, loss:479.8359680175781, time spent:41.34245777130127s None\n",
      " idx:770, loss:266.9342041015625, time spent:42.10186266899109s None\n",
      " idx:780, loss:231.04623413085938, time spent:42.251646518707275s None\n",
      " idx:790, loss:241.50491333007812, time spent:43.76507520675659s None\n",
      " idx:800, loss:285.65838623046875, time spent:43.9330313205719s None\n",
      " idx:810, loss:387.59210205078125, time spent:44.61711072921753s None\n",
      " idx:820, loss:584.1443481445312, time spent:45.26332879066467s None\n",
      " idx:830, loss:724.043701171875, time spent:46.17510151863098s None\n",
      " idx:840, loss:1363.191650390625, time spent:47.562084674835205s None\n",
      " idx:850, loss:773.3093872070312, time spent:48.27189636230469s None\n",
      " idx:860, loss:331.2591857910156, time spent:48.47621488571167s None\n",
      " idx:870, loss:467.33978271484375, time spent:49.55584454536438s None\n",
      " idx:880, loss:309.39556884765625, time spent:49.640501260757446s None\n",
      " idx:890, loss:633.554931640625, time spent:50.2125928401947s None\n",
      " idx:900, loss:1615.815185546875, time spent:51.49545645713806s None\n",
      " idx:910, loss:651.7349243164062, time spent:52.37300491333008s None\n",
      " idx:920, loss:794.4351806640625, time spent:52.90717911720276s None\n",
      " idx:930, loss:192.44012451171875, time spent:53.01695919036865s None\n",
      " idx:940, loss:211.04168701171875, time spent:53.14559864997864s None\n",
      " idx:950, loss:448.75274658203125, time spent:53.41246771812439s None\n",
      " idx:960, loss:343.5049743652344, time spent:53.740987062454224s None\n",
      " idx:970, loss:861.166015625, time spent:54.578107595443726s None\n",
      " idx:980, loss:115.75279235839844, time spent:55.372395753860474s None\n",
      " idx:990, loss:360.0771789550781, time spent:55.600114583969116s None\n",
      " idx:1000, loss:641.9230346679688, time spent:56.403982162475586s None\n",
      " idx:1010, loss:236.61663818359375, time spent:56.58580827713013s None\n",
      " idx:1020, loss:1023.5238647460938, time spent:57.29689145088196s None\n",
      " idx:1030, loss:182.1890869140625, time spent:57.41624426841736s None\n",
      " idx:1040, loss:355.9915771484375, time spent:57.79273343086243s None\n",
      " idx:1050, loss:582.3927001953125, time spent:58.70872735977173s None\n",
      " idx:1060, loss:661.85693359375, time spent:59.524190187454224s None\n",
      " idx:1070, loss:245.15090942382812, time spent:59.740522384643555s None\n",
      " idx:1080, loss:856.4286499023438, time spent:60.32989740371704s None\n",
      " idx:1090, loss:382.5146789550781, time spent:60.54090666770935s None\n",
      " idx:1100, loss:645.8067016601562, time spent:60.9437952041626s None\n",
      " idx:1110, loss:477.2557373046875, time spent:62.060954332351685s None\n",
      " idx:1120, loss:753.2366333007812, time spent:62.702462911605835s None\n",
      " idx:1130, loss:119.79524230957031, time spent:62.775142431259155s None\n",
      " idx:1140, loss:1003.484130859375, time spent:63.65060758590698s None\n",
      " idx:1150, loss:126.19800567626953, time spent:63.76438331604004s None\n",
      " idx:1160, loss:566.7479248046875, time spent:64.52454423904419s None\n",
      " idx:1170, loss:345.538818359375, time spent:65.54323077201843s None\n",
      " idx:1180, loss:207.17642211914062, time spent:66.40166115760803s None\n",
      " idx:1190, loss:1036.845947265625, time spent:67.39325451850891s None\n",
      " idx:1200, loss:1076.6439208984375, time spent:68.33259010314941s None\n",
      " idx:1210, loss:711.3775024414062, time spent:68.86581707000732s None\n",
      " idx:1220, loss:415.99310302734375, time spent:69.13558053970337s None\n",
      " idx:1230, loss:573.9747314453125, time spent:69.816401720047s None\n",
      " idx:1240, loss:163.60598754882812, time spent:69.88357019424438s None\n",
      " idx:1250, loss:381.17352294921875, time spent:70.15479326248169s None\n",
      " idx:1260, loss:481.5940246582031, time spent:70.38987636566162s None\n",
      " idx:1270, loss:686.8436279296875, time spent:70.68487930297852s None\n",
      " idx:1280, loss:321.744384765625, time spent:71.25772142410278s None\n",
      " idx:1290, loss:394.0511474609375, time spent:71.70515203475952s None\n",
      " idx:1300, loss:475.578857421875, time spent:72.28249955177307s None\n",
      " idx:1310, loss:540.1976318359375, time spent:73.74613642692566s None\n",
      " idx:1320, loss:762.4044189453125, time spent:74.32873225212097s None\n",
      " idx:1330, loss:1905.13916015625, time spent:75.73561215400696s None\n",
      " idx:1340, loss:171.16473388671875, time spent:75.88438034057617s None\n",
      " idx:1350, loss:349.3875427246094, time spent:76.02895998954773s None\n",
      " idx:1360, loss:601.3775634765625, time spent:76.49380874633789s None\n",
      " idx:1370, loss:380.1983947753906, time spent:76.82486033439636s None\n",
      " idx:1380, loss:273.2480773925781, time spent:76.98220539093018s None\n",
      " idx:1390, loss:913.4505615234375, time spent:77.60516262054443s None\n",
      " idx:1400, loss:547.5586547851562, time spent:78.27451038360596s None\n",
      " idx:1410, loss:310.2422180175781, time spent:78.5194571018219s None\n",
      " idx:1420, loss:857.4351196289062, time spent:79.14950394630432s None\n",
      " idx:1430, loss:971.093017578125, time spent:80.23026895523071s None\n",
      " idx:1440, loss:635.957275390625, time spent:80.62998723983765s None\n",
      " idx:1450, loss:779.849365234375, time spent:81.3353054523468s None\n",
      " idx:1460, loss:291.2571716308594, time spent:81.49147129058838s None\n",
      " idx:1470, loss:341.17767333984375, time spent:81.68166017532349s None\n",
      " idx:1480, loss:1324.702880859375, time spent:87.40842247009277s None\n",
      " idx:1490, loss:511.5342102050781, time spent:87.5646288394928s None\n",
      " idx:1500, loss:307.9888000488281, time spent:88.5711133480072s None\n",
      " idx:1510, loss:280.8848571777344, time spent:88.853590965271s None\n",
      " idx:1520, loss:193.52821350097656, time spent:88.9482946395874s None\n",
      " idx:1530, loss:155.00289916992188, time spent:89.16975998878479s None\n",
      " idx:1540, loss:351.6214904785156, time spent:89.35585737228394s None\n",
      " idx:1550, loss:154.94720458984375, time spent:89.45555186271667s None\n",
      " idx:1560, loss:384.9573974609375, time spent:89.72364664077759s None\n",
      " idx:1570, loss:547.484375, time spent:90.04673147201538s None\n",
      " idx:1580, loss:222.88856506347656, time spent:90.26407384872437s None\n",
      " idx:1590, loss:295.234130859375, time spent:90.78140234947205s None\n",
      " idx:1600, loss:377.16290283203125, time spent:91.32923197746277s None\n",
      " idx:1610, loss:138.00369262695312, time spent:91.40516686439514s None\n",
      " idx:1620, loss:204.1415557861328, time spent:91.59605884552002s None\n",
      " idx:1630, loss:1163.13232421875, time spent:92.510573387146s None\n",
      " idx:1640, loss:1155.4793701171875, time spent:93.76390838623047s None\n",
      " idx:1650, loss:182.88697814941406, time spent:94.27062153816223s None\n",
      " idx:1660, loss:689.083740234375, time spent:94.98890781402588s None\n",
      " idx:1670, loss:1177.3758544921875, time spent:96.01980662345886s None\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " idx:1680, loss:431.89935302734375, time spent:96.98751950263977s None\n",
      " idx:1690, loss:260.83056640625, time spent:97.27112913131714s None\n",
      " idx:1700, loss:900.7666625976562, time spent:98.08158731460571s None\n",
      " idx:1710, loss:626.664794921875, time spent:98.41043424606323s None\n",
      " idx:1720, loss:330.6615905761719, time spent:98.72637486457825s None\n",
      " idx:1730, loss:258.7769470214844, time spent:98.90488791465759s None\n",
      " idx:1740, loss:340.2421569824219, time spent:99.14391493797302s None\n",
      " idx:1750, loss:1029.47216796875, time spent:99.85184478759766s None\n"
     ]
    },
    {
     "ename": "KeyboardInterrupt",
     "evalue": "",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mKeyboardInterrupt\u001b[0m                         Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-9-ec9775ede022>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mrun\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;32m<ipython-input-8-f9cee79d1a82>\u001b[0m in \u001b[0;36mrun\u001b[0;34m()\u001b[0m\n\u001b[1;32m     29\u001b[0m         \u001b[0;32mwhile\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mtrain_generator\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mend\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     30\u001b[0m             \u001b[0minput_x\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtarget_id\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtarget_correctness\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mseqs_len\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmax_len\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtrain_generator\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mnext_batch\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 31\u001b[0;31m             \u001b[0mloss\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mmodel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstep\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msess\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0minput_x\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtarget_id\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtarget_correctness\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mseqs_len\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mis_train\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m     32\u001b[0m             print(\"\\r idx:{0}, loss:{1}, time spent:{2}s\".format(train_generator.pos, loss,\n\u001b[1;32m     33\u001b[0m                                                                          time.time() - st),\n",
      "\u001b[0;32m<ipython-input-7-0663547f9c86>\u001b[0m in \u001b[0;36mstep\u001b[0;34m(self, sess, input_x, target_id, target_correctness, sequence_len, is_train)\u001b[0m\n\u001b[1;32m     84\u001b[0m         \u001b[0;32mif\u001b[0m \u001b[0mis_train\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     85\u001b[0m             \u001b[0minput_feed\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mkeep_prob\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mkeep_prob_value\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 86\u001b[0;31m             \u001b[0mtrain_loss\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0m_\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0m_\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msess\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mloss\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtrain_op\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcurrent_state\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0minput_feed\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m     87\u001b[0m             \u001b[0;32mreturn\u001b[0m \u001b[0mtrain_loss\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     88\u001b[0m         \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m~/anaconda3/envs/jiang/lib/python3.5/site-packages/tensorflow/python/client/session.py\u001b[0m in \u001b[0;36mrun\u001b[0;34m(self, fetches, feed_dict, options, run_metadata)\u001b[0m\n\u001b[1;32m    887\u001b[0m     \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    888\u001b[0m       result = self._run(None, fetches, feed_dict, options_ptr,\n\u001b[0;32m--> 889\u001b[0;31m                          run_metadata_ptr)\n\u001b[0m\u001b[1;32m    890\u001b[0m       \u001b[0;32mif\u001b[0m \u001b[0mrun_metadata\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    891\u001b[0m         \u001b[0mproto_data\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtf_session\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mTF_GetBuffer\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mrun_metadata_ptr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m~/anaconda3/envs/jiang/lib/python3.5/site-packages/tensorflow/python/client/session.py\u001b[0m in \u001b[0;36m_run\u001b[0;34m(self, handle, fetches, feed_dict, options, run_metadata)\u001b[0m\n\u001b[1;32m   1118\u001b[0m     \u001b[0;32mif\u001b[0m \u001b[0mfinal_fetches\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0mfinal_targets\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mhandle\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0mfeed_dict_tensor\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1119\u001b[0m       results = self._do_run(handle, final_targets, final_fetches,\n\u001b[0;32m-> 1120\u001b[0;31m                              feed_dict_tensor, options, run_metadata)\n\u001b[0m\u001b[1;32m   1121\u001b[0m     \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1122\u001b[0m       \u001b[0mresults\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m~/anaconda3/envs/jiang/lib/python3.5/site-packages/tensorflow/python/client/session.py\u001b[0m in \u001b[0;36m_do_run\u001b[0;34m(self, handle, target_list, fetch_list, feed_dict, options, run_metadata)\u001b[0m\n\u001b[1;32m   1315\u001b[0m     \u001b[0;32mif\u001b[0m \u001b[0mhandle\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1316\u001b[0m       return self._do_call(_run_fn, self._session, feeds, fetches, targets,\n\u001b[0;32m-> 1317\u001b[0;31m                            options, run_metadata)\n\u001b[0m\u001b[1;32m   1318\u001b[0m     \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1319\u001b[0m       \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_do_call\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0m_prun_fn\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_session\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mhandle\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfeeds\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfetches\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m~/anaconda3/envs/jiang/lib/python3.5/site-packages/tensorflow/python/client/session.py\u001b[0m in \u001b[0;36m_do_call\u001b[0;34m(self, fn, *args)\u001b[0m\n\u001b[1;32m   1321\u001b[0m   \u001b[0;32mdef\u001b[0m \u001b[0m_do_call\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfn\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1322\u001b[0m     \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1323\u001b[0;31m       \u001b[0;32mreturn\u001b[0m \u001b[0mfn\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m   1324\u001b[0m     \u001b[0;32mexcept\u001b[0m \u001b[0merrors\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mOpError\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1325\u001b[0m       \u001b[0mmessage\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcompat\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mas_text\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0me\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmessage\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m~/anaconda3/envs/jiang/lib/python3.5/site-packages/tensorflow/python/client/session.py\u001b[0m in \u001b[0;36m_run_fn\u001b[0;34m(session, feed_dict, fetch_list, target_list, options, run_metadata)\u001b[0m\n\u001b[1;32m   1300\u001b[0m           return tf_session.TF_Run(session, options,\n\u001b[1;32m   1301\u001b[0m                                    \u001b[0mfeed_dict\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfetch_list\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtarget_list\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1302\u001b[0;31m                                    status, run_metadata)\n\u001b[0m\u001b[1;32m   1303\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1304\u001b[0m     \u001b[0;32mdef\u001b[0m \u001b[0m_prun_fn\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msession\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mhandle\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfeed_dict\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfetch_list\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mKeyboardInterrupt\u001b[0m: "
     ]
    }
   ],
   "source": [
    "run()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
